diff options
author | morpheus65535 <[email protected]> | 2022-11-20 11:21:47 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-11-20 11:21:47 -0500 |
commit | 551f57bc0ece32748c73b582ae3a54581f3e15db (patch) | |
tree | 18e0824fc37ae6cc8cb3034919149853e50334c0 | |
parent | 12143db41b29c7b2814c58d9aa41a553f42af271 (diff) | |
download | bazarr-551f57bc0ece32748c73b582ae3a54581f3e15db.tar.gz bazarr-551f57bc0ece32748c73b582ae3a54581f3e15db.zip |
Fixed bad subtitles extension exception when uploading subtitles with uppercase extension. #1988
-rw-r--r-- | bazarr/api/episodes/episodes_subtitles.py | 2 | ||||
-rw-r--r-- | bazarr/api/movies/movies_subtitles.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/bazarr/api/episodes/episodes_subtitles.py b/bazarr/api/episodes/episodes_subtitles.py index e44b498c6..300a58abc 100644 --- a/bazarr/api/episodes/episodes_subtitles.py +++ b/bazarr/api/episodes/episodes_subtitles.py @@ -140,7 +140,7 @@ class EpisodesSubtitles(Resource): _, ext = os.path.splitext(subFile.filename) - if ext not in SUBTITLE_EXTENSIONS: + if not isinstance(ext, str) or ext.lower() not in SUBTITLE_EXTENSIONS: raise ValueError('A subtitle of an invalid format was uploaded.') try: diff --git a/bazarr/api/movies/movies_subtitles.py b/bazarr/api/movies/movies_subtitles.py index ffd581a60..78bda7a9c 100644 --- a/bazarr/api/movies/movies_subtitles.py +++ b/bazarr/api/movies/movies_subtitles.py @@ -140,7 +140,7 @@ class MoviesSubtitles(Resource): _, ext = os.path.splitext(subFile.filename) - if ext not in SUBTITLE_EXTENSIONS: + if not isinstance(ext, str) or ext.lower() not in SUBTITLE_EXTENSIONS: raise ValueError('A subtitle of an invalid format was uploaded.') try: |