summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-05-02 15:22:58 +0200
committerBastien Nocera <hadess@hadess.net>2014-05-02 15:24:43 +0200
commit428fb7531e757fced35aaeae6c32f081bd0ff0a4 (patch)
tree2bf24730bbc08181e2e2e262b51957a7473ecc5c
parentb255b72c3b65b9a759cf783869823a8ea6ba6b0b (diff)
downloadtotem-428fb7531e757fced35aaeae6c32f081bd0ff0a4.tar.gz
opensubtitles: Save subtitles with the correct suffix
Instead of always saving files as "*.ass" (the last suffix listed in SUBTITLES_EXT), save with the extension for the file we're downloading.
-rw-r--r--src/plugins/opensubtitles/opensubtitles.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index 536c17d66..1ed836175 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -643,7 +643,7 @@ class OpenSubtitles (GObject.Object, # pylint: disable-msg=R0902
flags = Gio.FileCreateFlags.REPLACE_DESTINATION
try:
- subtitle_file = Gio.file_new_for_path (self._movie_dir() + sep + movie_name + '.' + ext)
+ subtitle_file = Gio.file_new_for_path (self._movie_dir() + sep + movie_name + '.' + extension)
print ('trying to save to ' + subtitle_file.get_uri())
suburi = subtitle_file.get_uri ()
@@ -651,7 +651,7 @@ class OpenSubtitles (GObject.Object, # pylint: disable-msg=R0902
sub_file.write (subtitles, None)
sub_file.close (None)
except:
- subtitle_file = Gio.file_new_for_path (self._cache_subtitles_dir() + sep + movie_name + '.' + ext)
+ subtitle_file = Gio.file_new_for_path (self._cache_subtitles_dir() + sep + movie_name + '.' + extension)
print ('saving to ' + subtitle_file.get_uri())
suburi = subtitle_file.get_uri ()