From 2a547ef2cfed7a3e7a752081360419ba1815e009 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 24 Sep 2026 10:59:47 -0400 Subject: [PATCH] fix(lint): address SIM102 --- tubesync/sync/models/media__tasks.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tubesync/sync/models/media__tasks.py b/tubesync/sync/models/media__tasks.py index 6bf05e5b..907dc013 100644 --- a/tubesync/sync/models/media__tasks.py +++ b/tubesync/sync/models/media__tasks.py @@ -81,12 +81,11 @@ def download_checklist(self, skip_checks=False): return False max_cap_age = media.source.download_cap_date published = media.published - if max_cap_age and published: - if published <= max_cap_age: - log.warn(f'Download task triggered media: {media} (UUID: {media.pk}) but ' - f'the source has a download cap and the media is now too old, ' - f'not downloading') - return False + if max_cap_age and published and published <= max_cap_age: + log.warn(f'Download task triggered media: {media} (UUID: {media.pk}) but ' + f'the source has a download cap and the media is now too old, ' + f'not downloading') + return False return True