[totem] opensubtitles: Save subtitles with the correct suffix



commit 9d5e2e92c108eb1e0bc50e5a3f1ef27785ee5b9e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 2 15:22:58 2014 +0200

    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.

 src/plugins/opensubtitles/opensubtitles.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index 536c17d..1ed8361 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 ()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]