rssVideos: Add --seen flag

This commit is contained in:
Geoffrey Frogeye 2021-12-18 22:23:48 +01:00
parent 1948fc0af2
commit f4c81e346a
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -194,8 +194,8 @@ class RVElement:
} }
def matches_filter(self, args: configargparse.Namespace) -> bool: def matches_filter(self, args: configargparse.Namespace) -> bool:
if self.watched: if args.seen != "any" and (args.seen == "seen") != self.watched:
log.debug(f"Already watched: {self}") log.debug(f"Not {args.seen}: {self}")
return False return False
if args.title and not re.search(args.title, self.title): if args.title and not re.search(args.title, self.title):
log.debug(f"Title not matching {args.title}: {self}") log.debug(f"Title not matching {args.title}: {self}")
@ -447,6 +447,7 @@ def get_args() -> configargparse.Namespace:
parser.add("--title", help="Regex to filter by title") parser.add("--title", help="Regex to filter by title")
parser.add("--link", help="Regex to filter by link") parser.add("--link", help="Regex to filter by link")
parser.add("--duration", help="Comparative to filter by duration") parser.add("--duration", help="Comparative to filter by duration")
parser.add("--seen", choices=("seen","unseen","any"), default="unseen", help="Only include seen/unseen/any videos")
# TODO Envrionment variables # TODO Envrionment variables
parser.add( parser.add(
"--max-duration", "--max-duration",