From 68de80748344ea51eadb6320fcc3706cb65b2aaa Mon Sep 17 00:00:00 2001 From: meeb Date: Thu, 18 Jul 2024 01:42:36 +1000 Subject: [PATCH] add check that media items have a published date from metadata set before checking for download caps when filtering, resolves #519 (related to #515) --- tubesync/sync/filtering.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tubesync/sync/filtering.py b/tubesync/sync/filtering.py index 82c1792..351b3f8 100644 --- a/tubesync/sync/filtering.py +++ b/tubesync/sync/filtering.py @@ -100,6 +100,15 @@ def filter_filter_text(instance: Media): def filter_max_cap(instance: Media): + + if instance.published is None: + log.debug( + f"Media: {instance.source} / {instance} has no published date " + f"set (likely not downloaded metadata) so not filtering based on " + f"publish date" + ) + return False + max_cap_age = instance.source.download_cap_date if not max_cap_age: log.debug(