Merge pull request #1048 from tcely/patch-12

Downloading media fixes
This commit is contained in:
meeb 2025-05-20 16:32:39 +10:00 committed by GitHub
commit 76bac6e48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -1,9 +1,11 @@
import os
from pathlib import Path
from common.logger import log
from common.errors import (
NoMetadataException,
)
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from ..choices import Val, SourceResolution
@ -47,6 +49,7 @@ def download_checklist(self, skip_checks=False):
f'the source has a download cap and the media is now too old, '
f'not downloading')
return False
return True
def download_finished(self, format_str, container, downloaded_filepath=None):

View File

@ -635,6 +635,8 @@ def download_media(media_id, override=False):
raise InvalidTaskError(_('no such media')) from e
else:
if not media.download_checklist(override):
# any condition that needs to reschedule the task
# should raise an exception to avoid this
return
filepath = media.filepath