aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2019-09-08 23:08:30 -0400
committerLouis Vézina <[email protected]>2019-09-08 23:08:30 -0400
commitbaa56f58c98d12626cd7812bd5e8e91521fbebc3 (patch)
tree330c966fe66ce1fa520e4921ee144790729516e7
parent36c0d2d311abd50fd8f6f122e4758bd0da5ad5af (diff)
downloadbazarr-baa56f58c98d12626cd7812bd5e8e91521fbebc3.tar.gz
bazarr-baa56f58c98d12626cd7812bd5e8e91521fbebc3.zip
Fix for list_subtitles doing path mapping over already mapped path.
-rw-r--r--bazarr/list_subtitles.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py
index c14e8712d..63e33c41d 100644
--- a/bazarr/list_subtitles.py
+++ b/bazarr/list_subtitles.py
@@ -80,7 +80,7 @@ def store_subtitles(file):
else:
if os.path.splitext(subtitle)[1] != ".sub":
logging.debug("BAZARR falling back to file content analysis to detect language.")
- with open(path_replace(os.path.join(os.path.dirname(file), subtitle)), 'r') as f:
+ with open(os.path.join(os.path.dirname(file), subtitle), 'r') as f:
text = list(islice(f, 100))
text = ' '.join(text)
encoding = UnicodeDammit(text)
@@ -89,9 +89,9 @@ def store_subtitles(file):
detected_language = langdetect.detect(text)
except Exception as e:
logging.exception(
- 'BAZARR Error trying to detect language for this subtitles file: ' + path_replace(
- os.path.join(os.path.dirname(file),
- subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
+ 'BAZARR Error trying to detect language for this subtitles file: ' +
+ os.path.join(os.path.dirname(file), subtitle) +
+ ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
else:
if len(detected_language) > 0:
logging.debug(
@@ -171,8 +171,7 @@ def store_subtitles_movie(file):
else:
if os.path.splitext(subtitle)[1] != ".sub":
logging.debug("BAZARR falling back to file content analysis to detect language.")
- with open(path_replace_movie(os.path.join(os.path.dirname(file), dest_folder, subtitle)),
- 'r') as f:
+ with open(os.path.join(os.path.dirname(file), dest_folder, subtitle), 'r') as f:
text = list(islice(f, 100))
text = ' '.join(text)
encoding = UnicodeDammit(text)
@@ -181,9 +180,9 @@ def store_subtitles_movie(file):
detected_language = langdetect.detect(text)
except Exception as e:
logging.exception(
- 'BAZARR Error trying to detect language for this subtitles file: ' + path_replace(
- os.path.join(os.path.dirname(file),
- subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
+ 'BAZARR Error trying to detect language for this subtitles file: ' +
+ os.path.join(os.path.dirname(file), subtitle) +
+ ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
else:
if len(detected_language) > 0:
logging.debug(