Downgrade logs to to info, make error message more helpful

pull/515/head
Tim 2024-07-11 17:51:50 +08:00
parent 510f4c2f60
commit 1dea5b05fd
2 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ def filter_media(instance: Media):
# Check if skipping # Check if skipping
if instance.skip != skip: if instance.skip != skip:
instance.skip = skip instance.skip = skip
log.warn(f'Media: {instance.source} / {instance} has changed skip setting to {skip}') log.info(f'Media: {instance.source} / {instance} has changed skip setting to {skip}')
return True return True
return False return False
@ -40,7 +40,7 @@ def filter_media(instance: Media):
def filter_published(instance: Media): def filter_published(instance: Media):
# Check if the instance is not published, we have to skip then # Check if the instance is not published, we have to skip then
if not isinstance(instance.published, datetime): if not isinstance(instance.published, datetime):
log.warn(f'Media: {instance.source} / {instance} has no published date ' log.info(f'Media: {instance.source} / {instance} has no published date '
f'set, marking to be skipped') f'set, marking to be skipped')
return True return True
return False return False
@ -85,13 +85,13 @@ def filter_source_cutoff(instance: Media):
if instance.source.delete_old_media and instance.source.days_to_keep > 0: if instance.source.delete_old_media and instance.source.days_to_keep > 0:
if not isinstance(instance.published, datetime): if not isinstance(instance.published, datetime):
# Media has no known published date or incomplete metadata # Media has no known published date or incomplete metadata
log.warn(f'Media: {instance.source} / {instance} has no published date, skipping') log.info(f'Media: {instance.source} / {instance} has no published date, skipping')
return True return True
delta = timezone.now() - timedelta(days=instance.source.days_to_keep) delta = timezone.now() - timedelta(days=instance.source.days_to_keep)
if instance.published < delta: if instance.published < delta:
# Media was published after the cutoff date, skip it # Media was published after the cutoff date, skip it
log.warn(f'Media: {instance.source} / {instance} is older than ' log.info(f'Media: {instance.source} / {instance} is older than '
f'{instance.source.days_to_keep} days, skipping') f'{instance.source.days_to_keep} days, skipping')
return True return True

View File

@ -25,7 +25,7 @@
{% if media.manual_skip %}{% include 'errorbox.html' with message='Media is marked to be skipped and will not be downloaded.' %} {% if media.manual_skip %}{% include 'errorbox.html' with message='Media is marked to be skipped and will not be downloaded.' %}
{% else %} {% else %}
{% if not media.can_download %}{% include 'errorbox.html' with message='Media cannot be downloaded because it has no formats which match the source requirements.' %}{% endif %} {% if not media.can_download %}{% include 'errorbox.html' with message='Media cannot be downloaded because it has no formats which match the source requirements.' %}{% endif %}
{% if media.skip %}{% include 'errorbox.html' with message='This media may be skipped due to error(s).' %}{% endif %} {% if media.skip %}{% include 'errorbox.html' with message='This media may be skipped due to error(s) or not matching a filter condition.' %}{% endif %}
{% endif %} {% endif %}
{% include 'infobox.html' with message=message %} {% include 'infobox.html' with message=message %}
<div class="row"> <div class="row">