summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-06-28 08:55:30 -0400
committermorpheus65535 <[email protected]>2022-06-28 08:55:30 -0400
commit3a14099e3650ca40cf2b0f538e08432271c2d1b4 (patch)
treeb78b0d9f9cbe6d866e2813fa029eb06cc0507501
parent34685b3d19960ee119f832a00264a667d777bfeb (diff)
downloadbazarr-3a14099e3650ca40cf2b0f538e08432271c2d1b4.tar.gz
bazarr-3a14099e3650ca40cf2b0f538e08432271c2d1b4.zip
Fixed deletion of subtitles with file extension other than srt.
-rw-r--r--bazarr/subtitles/tools/delete.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bazarr/subtitles/tools/delete.py b/bazarr/subtitles/tools/delete.py
index 29d8f12b3..546d04df2 100644
--- a/bazarr/subtitles/tools/delete.py
+++ b/bazarr/subtitles/tools/delete.py
@@ -3,6 +3,8 @@
import os
import logging
+from subliminal.subtitle import SUBTITLE_EXTENSIONS
+
from app.event_handler import event_stream
from languages.get_languages import language_from_alpha2
from utilities.path_mappings import path_mappings
@@ -16,8 +18,8 @@ from radarr.notify import notify_radarr
def delete_subtitles(media_type, language, forced, hi, media_path, subtitles_path, sonarr_series_id=None,
sonarr_episode_id=None, radarr_id=None):
- if not subtitles_path.endswith('.srt'):
- logging.error('BAZARR can only delete .srt files.')
+ if not os.path.splitext(subtitles_path)[1] in SUBTITLE_EXTENSIONS:
+ logging.error('BAZARR can only delete subtitles files.')
return False
language_log = language