Remove subtitles also

Fixes #416
This commit is contained in:
tcely 2025-02-09 02:21:16 -05:00 committed by GitHub
parent 8d89cc01f9
commit 4dbb0c5196
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,7 +221,7 @@ def media_post_delete(sender, instance, **kwargs):
video_path = Path(str(instance.media_file.path)).resolve()
instance.media_file.delete(save=False)
# the other files we created have these known suffixes
for suffix in frozenset(('nfo', 'jpg', 'webp', 'info.json',)):
for suffix in frozenset(('nfo', 'jpg', 'webp', 'vtt', 'info.json',)):
other_path = video_path.with_suffix(f'.{suffix}').resolve()
log.info(f'Deleting file for: {instance} path: {other_path!s}')
delete_file(other_path)