Skip to content

Commit

Permalink
Fixed deletion of subtitles with file extension other than srt.
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Jun 28, 2022
1 parent 34685b3 commit 3a14099
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bazarr/subtitles/tools/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,8 +18,8 @@

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
Expand Down

0 comments on commit 3a14099

Please sign in to comment.