Only log new media

Channels with thousands of videos, that won't be downloaded, create large blocks in the logs without this.
This commit is contained in:
tcely 2024-12-23 10:17:58 -05:00 committed by GitHub
parent 904c57f603
commit 2799d95119
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -191,7 +191,10 @@ def index_source_task(source_id):
media.source = source media.source = source
try: try:
media.save() media.save()
log.info(f'Indexed media: {source} / {media}') log.debug(f'Indexed media: {source} / {media}')
# log the new media instances
if media.created >= source.last_crawl:
log.info(f'Indexed new media: {source} / {media}')
except IntegrityError as e: except IntegrityError as e:
log.error(f'Index media failed: {source} / {media} with "{e}"') log.error(f'Index media failed: {source} / {media} with "{e}"')
# Tack on a cleanup of old completed tasks # Tack on a cleanup of old completed tasks