mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-07 21:56:49 +00:00
Log OSError
when checking for existing media files
This commit is contained in:
parent
73972c8b0c
commit
f5fcfd2e1e
@ -272,8 +272,15 @@ def media_post_save(sender, instance, created, **kwargs):
|
|||||||
thumbnail_url,
|
thumbnail_url,
|
||||||
verbose_name=verbose_name.format(instance.name),
|
verbose_name=verbose_name.format(instance.name),
|
||||||
)
|
)
|
||||||
|
media_file_exists = False
|
||||||
|
try:
|
||||||
|
media_file_exists |= instance.media_file_exists
|
||||||
|
media_file_exists |= instance.filepath.exists()
|
||||||
|
except OSError as e:
|
||||||
|
log.exception(e)
|
||||||
|
pass
|
||||||
# If the media has not yet been downloaded schedule it to be downloaded
|
# If the media has not yet been downloaded schedule it to be downloaded
|
||||||
if not (instance.media_file_exists or instance.filepath.exists() or existing_media_download_task):
|
if not (media_file_exists or existing_media_download_task):
|
||||||
# The file was deleted after it was downloaded, skip this media.
|
# The file was deleted after it was downloaded, skip this media.
|
||||||
if instance.can_download and instance.downloaded:
|
if instance.can_download and instance.downloaded:
|
||||||
skip_changed = True != instance.skip
|
skip_changed = True != instance.skip
|
||||||
|
Loading…
Reference in New Issue
Block a user