add XML NFO file writing support, rework media cleanup deletion, resolves #11
This commit is contained in:
@@ -145,20 +145,6 @@ def media_pre_delete(sender, instance, **kwargs):
|
||||
if thumbnail_url:
|
||||
delete_task_by_media('sync.tasks.download_media_thumbnail',
|
||||
(str(instance.pk), thumbnail_url))
|
||||
# Delete media thumbnail if it exists
|
||||
if instance.thumb:
|
||||
log.info(f'Deleting thumbnail for: {instance} path: {instance.thumb.path}')
|
||||
delete_file(instance.thumb.path)
|
||||
# Delete the media file if it exists
|
||||
if instance.media_file:
|
||||
filepath = instance.media_file.path
|
||||
log.info(f'Deleting media for: {instance} path: {filepath}')
|
||||
delete_file(filepath)
|
||||
# Delete thumbnail copy if it exists
|
||||
barefilepath, fileext = os.path.splitext(filepath)
|
||||
thumbpath = f'{barefilepath}.jpg'
|
||||
log.info(f'Deleting thumbnail for: {instance} path: {thumbpath}')
|
||||
delete_file(thumbpath)
|
||||
|
||||
|
||||
@receiver(post_delete, sender=Media)
|
||||
|
||||
Reference in New Issue
Block a user