The branch, dharma has been updated
       via  70a8c8bc10b2922fbbb82a28056b0f91d2861337 (commit)
      from  973eea484e4a7e6aad617c39f9c9c6905cc67517 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=70a8c8bc10b2922fbbb82a28056b0f91d2861337

commit 70a8c8bc10b2922fbbb82a28056b0f91d2861337
Author: amet <[email protected]>
Date:   Wed Apr 27 11:58:17 2011 +0400

    [script.xbmc.subtitles] -v2.4.6
    
    - fixes: Service LegendasDivx.com v0.2.2
    - fixed: "Add Language To Filename" was ignored in some cases

diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index c1de4e8..a274e8f 100644
--- a/script.xbmc.subtitles/addon.xml
+++ b/script.xbmc.subtitles/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.xbmc.subtitles"
        name="XBMC Subtitles"
-       version="2.4.5"
+       version="2.4.6"
        provider-name="Amet, mr_blobby">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt 
b/script.xbmc.subtitles/changelog.txt
index 12c5fa2..1f66daf 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,7 @@
+2.4.6
+- fixes: Service LegendasDivx.com v0.2.2
+- fixed: "Add Language To Filename" was ignored in some cases
+
 2.4.5
 - fixes in LegendasDivx.com version 0.2.0/0.2.1
 - fixed: BetaSeries fetching .ass subtitle in archive cause some issues
diff --git a/script.xbmc.subtitles/resources/lib/gui.py 
b/script.xbmc.subtitles/resources/lib/gui.py
index 88b6da7..4bfa9e8 100644
--- a/script.xbmc.subtitles/resources/lib/gui.py
+++ b/script.xbmc.subtitles/resources/lib/gui.py
@@ -411,7 +411,10 @@ class GUI( xbmcgui.WindowXMLDialog ):
   def create_name(self,zip_entry,sub_filename,subtitle_lang):
     sub_ext  = os.path.splitext( zip_entry )[1]
     sub_name = os.path.splitext( sub_filename )[0]
-    file_name = "%s.%s%s" % ( sub_name, subtitle_lang, sub_ext )   
+    if (__settings__.getSetting( "lang_to_end" ) == "true"):
+      file_name = "%s.%s%s" % ( sub_name, subtitle_lang, sub_ext )
+    else:
+      file_name = "%s%s" % ( sub_name, sub_ext )  
     file_path = os.path.join(self.sub_folder, file_name)
     subtitle_file = os.path.join(self.tmp_sub_dir, zip_entry)
     return subtitle_file, file_path
diff --git 
a/script.xbmc.subtitles/resources/lib/services/LegendasDivx/service.py 
b/script.xbmc.subtitles/resources/lib/services/LegendasDivx/service.py
index 6425407..be7702c 100644
--- a/script.xbmc.subtitles/resources/lib/services/LegendasDivx/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/LegendasDivx/service.py
@@ -8,6 +8,9 @@
 # http://www.teknorage.com
 # License: GPL v2
 #
+# NEW on Service LegendasDivx.com v0.2.2:
+# Fixed pathnames using (os.sep). For sure :)
+#
 # NEW on Service LegendasDivx.com v0.2.1:
 # Fixed bug when the file is played from a root path, no parent dir 
search\sync when that happens.
 # Fixed pathnames to work with all OS (Win, Unix, etc).
@@ -130,9 +133,17 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
                        #Find filename on the comentaries to show sync label 
using filename or dirname (making it global for further usage)
                        global filesearch
                        filesearch = os.path.abspath(file_original_path)
+                       #For DEBUG only uncomment next line
+                       #log( __name__ ,"%s abspath: '%s'" % (debug_pretext, 
filesearch))
                        filesearch = os.path.split(filesearch)
-                       dirsearch = string.split(filesearch[0], '\\')
+                       #For DEBUG only uncomment next line
+                       #log( __name__ ,"%s path.split: '%s'" % (debug_pretext, 
filesearch))
+                       dirsearch = filesearch[0].split(os.sep)
+                       #For DEBUG only uncomment next line
+                       #log( __name__ ,"%s dirsearch: '%s'" % (debug_pretext, 
dirsearch))
                        dirsearch_check = string.split(dirsearch[-1], '.')
+                       #For DEBUG only uncomment next line
+                       #log( __name__ ,"%s dirsearch_check: '%s'" % 
(debug_pretext, dirsearch_check))
                        if (searchstring_notclean != ""):
                                sync = False
                                if re.search(searchstring_notclean, desc):
@@ -193,7 +204,7 @@ def search_subtitles( file_original_path, title, tvshow, 
year, season, episode,
        global israr
        israr = os.path.abspath(file_original_path)
        israr = os.path.split(israr)
-       israr = string.split(israr[0], '\\')
+       israr = israr[0].split(os.sep)
        israr = string.split(israr[-1], '.')
        israr = string.lower(israr[-1])
        
@@ -202,7 +213,7 @@ def search_subtitles( file_original_path, title, tvshow, 
year, season, episode,
                        if 'cd1' in string.lower(title) or 'cd2' in 
string.lower(title) or 'cd3' in string.lower(title):
                                dirsearch = os.path.abspath(file_original_path)
                                dirsearch = os.path.split(dirsearch)
-                               dirsearch = string.split(dirsearch[0], '\\')
+                               dirsearch = dirsearch[0].split(os.sep)
                                if len(dirsearch) > 1:
                                        searchstring_notclean = dirsearch[-3]
                                        searchstring = 
xbmc.getCleanMovieTitle(dirsearch[-3])
@@ -214,7 +225,7 @@ def search_subtitles( file_original_path, title, tvshow, 
year, season, episode,
                elif 'cd1' in string.lower(title) or 'cd2' in 
string.lower(title) or 'cd3' in string.lower(title):
                        dirsearch = os.path.abspath(file_original_path)
                        dirsearch = os.path.split(dirsearch)
-                       dirsearch = string.split(dirsearch[0], '\\')
+                       dirsearch = dirsearch[0].split(os.sep)
                        if len(dirsearch) > 1:
                                searchstring_notclean = dirsearch[-2]
                                searchstring = 
xbmc.getCleanMovieTitle(dirsearch[-2])
@@ -344,12 +355,12 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
                                searchsubscount = len(searchsubs)
                                for filesub in searchsubs:
                                        nopath = string.split(filesub, 
tmp_sub_dir)[-1]
-                                       justfile = string.split(nopath, 
'\\')[-1]
+                                       justfile = nopath.split(os.sep)[-1]
                                        #For DEBUG only uncomment next line
                                        #log( __name__ ,"%s DEBUG-nopath: '%s'" 
% (debug_pretext, nopath))
                                        #log( __name__ ,"%s DEBUG-justfile: 
'%s'" % (debug_pretext, justfile))
                                        releasefilename = 
filesearch[1][:len(filesearch[1])-4]
-                                       releasedirname = 
string.split(filesearch[0], '\\')
+                                       releasedirname = 
filesearch[0].split(os.sep)
                                        if 'rar' in israr:
                                                releasedirname = 
releasedirname[-2]
                                        else:

-----------------------------------------------------------------------

Summary of changes:
 script.xbmc.subtitles/addon.xml                    |    2 +-
 script.xbmc.subtitles/changelog.txt                |    4 +++
 script.xbmc.subtitles/resources/lib/gui.py         |    5 +++-
 .../resources/lib/services/LegendasDivx/service.py |   23 ++++++++++++++-----
 4 files changed, 26 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to