The branch, gotham has been updated
       via  d9115eec79c4711f740d8cdbf0f47955d3755b36 (commit)
      from  1053c5b1bfdc4c8fc026d4ab6e87aff17f57b778 (commit)

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

commit d9115eec79c4711f740d8cdbf0f47955d3755b36
Author: Martijn Kaijser <[email protected]>
Date:   Sun Aug 17 11:43:25 2014 +0200

    [service.subtitles.podnapisi] 5.0.8

diff --git a/service.subtitles.podnapisi/addon.xml 
b/service.subtitles.podnapisi/addon.xml
index 524424d..d80b7a3 100755
--- a/service.subtitles.podnapisi/addon.xml
+++ b/service.subtitles.podnapisi/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="service.subtitles.podnapisi"
        name="Podnapisi.net"
-       version="5.0.7"
+       version="5.0.8"
        provider-name="amet">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
diff --git a/service.subtitles.podnapisi/changelog.txt 
b/service.subtitles.podnapisi/changelog.txt
index 7b60b65..a2a0c23 100644
--- a/service.subtitles.podnapisi/changelog.txt
+++ b/service.subtitles.podnapisi/changelog.txt
@@ -1,3 +1,7 @@
+5.0.8
+- cleanup logging
+- simplify search for multiple languages, its possible to send all 3 languages 
in one search query
+
 5.0.7
 - cleanup, notify if login fails
 
diff --git a/service.subtitles.podnapisi/resources/lib/pn_utilities.py 
b/service.subtitles.podnapisi/resources/lib/pn_utilities.py
index 1619129..6dd6a90 100644
--- a/service.subtitles.podnapisi/resources/lib/pn_utilities.py
+++ b/service.subtitles.podnapisi/resources/lib/pn_utilities.py
@@ -23,6 +23,7 @@ __scriptname__ = sys.modules[ "__main__" ].__scriptname__
 __version__    = sys.modules[ "__main__" ].__version__
 __cwd__        = sys.modules[ "__main__" ].__cwd__
 __language__   = sys.modules[ "__main__" ].__language__
+__scriptid__   = sys.modules[ "__main__" ].__scriptid__
 
 USER_AGENT = "%s_v%s" % (__scriptname__.replace(" ","_"),__version__ )
 
@@ -113,7 +114,7 @@ def hashFile(file_path, rar=False):
     if rar:
       return OpensubtitlesHashRar(file_path)
       
-    log( __name__,"Hash Standard file")  
+    log( __scriptid__,"Hash Standard file")  
     longlongformat = 'q'  # long long
     bytesize = struct.calcsize(longlongformat)
     f = xbmcvfs.File(file_path)
@@ -192,20 +193,12 @@ class OSDBServer:
   def searchsubtitlesbyname_pod( self, name, tvshow, season, episode, lang, 
year, stack ):
     if len(tvshow) > 1:
       name = tvshow
-    search_url=[]              
-    search_url_base = 
"http://www.podnapisi.net/ppodnapisi/search?tbsl=1&sK=%s&sJ=%s&sY=%s&sTS=%s&sTE=%s&sXML=1&lang=0";
 % (name.replace(" ","+"), "%s", str(year), str(season), str(episode))
     
-    subtitles = None
+    url = 
"http://www.podnapisi.net/ppodnapisi/search?tbsl=1&sK=%s&sJ=%s&sY=%s&sTS=%s&sTE=%s&sXML=1&lang=0";
 % (name.replace(" ","+"), ','.join(lang), str(year), str(season), str(episode))
+    log( __scriptid__ ,"Search URL - %s" % (url))
     
-    for i in range(len(lang)):
-      url = search_url_base % str(lang[i])
-      log( __name__ ,"%s - Language %i" % (url,i))
-      temp_subs = self.fetch(url)
-      if temp_subs:
-        if subtitles:
-          subtitles = subtitles + temp_subs
-        else:
-          subtitles = temp_subs        
+    subtitles = self.fetch(url)
+         
     try:
       if subtitles:
         for subtitle in subtitles:
@@ -239,7 +232,7 @@ class OSDBServer:
       pod_session = init['session']
       auth = podserver.authenticate(pod_session, __addon__.getSetting( 
"PNuser" ), password256)
       if auth['status'] == 300: 
-        log( __name__ ,__language__(32005))
+        log( __scriptid__ ,__language__(32005))
         xbmc.executebuiltin(u'Notification(%s,%s,5000,%s)' %(__scriptname__,
                                                              
__language__(32005),
                                                              
os.path.join(__cwd__,"icon.png")
diff --git a/service.subtitles.podnapisi/service.py 
b/service.subtitles.podnapisi/service.py
index f7d14c6..ed3d715 100644
--- a/service.subtitles.podnapisi/service.py
+++ b/service.subtitles.podnapisi/service.py
@@ -39,7 +39,7 @@ def Search( item ):
   else:
     try:
       file_size, SubHash = hashFile(item['file_original_path'], item['temp'])
-      log( __name__ ,"xbmc module hash and size")
+      log( __scriptid__ ,"xbmc module hash and size")
       hash_search = True
     except:  
       file_size   = ""
@@ -47,13 +47,13 @@ def Search( item ):
       hash_search = False
   
   if file_size != "" and SubHash != "":
-    log( __name__ ,"File Size [%s]" % file_size )
-    log( __name__ ,"File Hash [%s]" % SubHash)
+    log( __scriptid__ ,"File Size [%s]" % file_size )
+    log( __scriptid__ ,"File Hash [%s]" % SubHash)
   if hash_search :
-    log( __name__ ,"Search for [%s] by hash" % (os.path.basename( 
item['file_original_path'] ),))
+    log( __scriptid__ ,"Search for [%s] by hash" % (os.path.basename( 
item['file_original_path'] ),))
     subtitles_list = osdb_server.searchsubtitles_pod( SubHash 
,item['3let_language'], False)
   if not subtitles_list:
-    log( __name__ ,"Search for [%s] by name" % (os.path.basename( 
item['file_original_path'] ),))
+    log( __scriptid__ ,"Search for [%s] by name" % (os.path.basename( 
item['file_original_path'] ),))
     subtitles_list = osdb_server.searchsubtitlesbyname_pod(item['title'],
                                                            item['tvshow'],
                                                            item['season'],
@@ -88,7 +88,7 @@ def Download(url,filename):
   subtitle_list = []
 
   try:
-    log( __name__ ,"Extract using 'ZipFile' method")
+    log( __scriptid__ ,"Extract using 'ZipFile' method")
     response = urllib2.urlopen(url)
     raw = response.read()      
     archive = ZipFile(StringIO(raw), 'r')
@@ -111,7 +111,7 @@ def Download(url,filename):
       subtitle_list.append(dest)
       index += 1
   except:
-    log( __name__ ,"Extract using 'XBMC.Extract' method")
+    log( __scriptid__ ,"Extract using 'XBMC.Extract' method")
     exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass" ]
     zip = os.path.join( __temp__, "PN.zip")
     f = urllib.urlopen(url)
@@ -152,7 +152,7 @@ def get_params(string=""):
 params = get_params()
 
 if params['action'] == 'search':
-  log( __name__, "action 'search' called")
+  log( __scriptid__, "action 'search' called")
   item = {}
   item['temp']               = False
   item['rar']                = False
@@ -168,7 +168,7 @@ if params['action'] == 'search':
     item['3let_language'].append(languageTranslate(lang,0,1))
   
   if item['title'] == "":
-    log( __name__, "VideoPlayer.OriginalTitle not found")
+    log( __scriptid__, "VideoPlayer.OriginalTitle not found")
     item['title']  = normalizeString(xbmc.getInfoLabel("VideoPlayer.Title"))   
   # no original title, get just Title
     
   if item['episode'].lower().find("s") > -1:                                   
   # Check if season is "Special"

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

Summary of changes:
 service.subtitles.podnapisi/addon.xml              |    2 +-
 service.subtitles.podnapisi/changelog.txt          |    4 +++
 .../resources/lib/pn_utilities.py                  |   21 ++++++-------------
 service.subtitles.podnapisi/service.py             |   18 ++++++++--------
 4 files changed, 21 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to