/[projects]/misc/xbmc/plugin.video.todic/default.py
ViewVC logotype

Diff of /misc/xbmc/plugin.video.todic/default.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1914 by torben, Thu Jan 17 18:44:47 2013 UTC revision 1972 by torben, Thu Apr 18 16:18:22 2013 UTC
# Line 3  Line 3 
3    
4  '''  '''
5      Todic plugin for XBMC      Todic plugin for XBMC
6      Version 0.0.2      Version 0.0.9
7  '''  '''
8    
9  import sys  import sys
# Line 139  def buildList(url,title, endlist=True): Line 139  def buildList(url,title, endlist=True):
139                          playcount = '0'                          playcount = '0'
140                  playcount = int(playcount)                  playcount = int(playcount)
141    
                 name = name.encode('latin-1')  
                 description = description.encode('latin-1')  
142    
143  ##              print "name:" + name  ##              print "name:" + name
144  #               print "url:" + url  #               print "url:" + url
# Line 157  def buildList(url,title, endlist=True): Line 155  def buildList(url,title, endlist=True):
155                          infoLabels['playcount'] = playcount                          infoLabels['playcount'] = playcount
156                          listitem.setInfo('video', infoLabels)                          listitem.setInfo('video', infoLabels)
157    
158                    name = name.encode('UTF-8')
159                    description = description.encode('UTF-8')
160    
161    
162                  u = sys.argv[0] + "?mode=" + urllib.quote(mode) + "&name=" + urllib.quote(name) + "&url=" + urllib.quote(url)                  u = sys.argv[0] + "?mode=" + urllib.quote(mode) + "&name=" + urllib.quote(name) + "&url=" + urllib.quote(url)
163                  ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = folder, totalItems = l)                  ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = folder, totalItems = l)
164    
# Line 177  def play_video(url, name): Line 179  def play_video(url, name):
179          subtitleurl = getText( doc.getElementsByTagName("subtitles") )          subtitleurl = getText( doc.getElementsByTagName("subtitles") )
180          subtitlesfile = os.path.join(datapath,'temp.srt')          subtitlesfile = os.path.join(datapath,'temp.srt')
181    
182            #if old srt file exists delete it first
183            if os.path.isfile(subtitlesfile):
184                    os.unlink(subtitlesfile)
185    
186          print '[TODIC] subs: '+str(subtitleurl)          print '[TODIC] subs: '+str(subtitleurl)
187          if len(subtitleurl) > 0:          if len(subtitleurl) > 0:
188                  subtitles = open_url(subtitleurl)                  subtitles = open_url(subtitleurl)
# Line 205  def play_video(url, name): Line 211  def play_video(url, name):
211                  if os.path.isfile(subtitlesfile):                  if os.path.isfile(subtitlesfile):
212                          player.setSubtitles(subtitlesfile)                          player.setSubtitles(subtitlesfile)
213                          print 'TODIC started subtitles'                          print 'TODIC started subtitles'
214                    else:
215                            player.disableSubtitles()
216    
217  #       player.callbackLoop()  #       player.callbackLoop()
218    
# Line 287  except: Line 295  except:
295          pass          pass
296    
297  if url == 'refresh':  if url == 'refresh':
298          xbmc.output("[tvserver] Container.Refresh")          #xbmc.output("[tvserver] Container.Refresh") #20130418 xbmc.output virker ikke med XBMC12
299          xbmc.executebuiltin("Container.Refresh")          xbmc.executebuiltin("Container.Refresh")
300                    
301    

Legend:
Removed from v.1914  
changed lines
  Added in v.1972

  ViewVC Help
Powered by ViewVC 1.1.20