Minor fixes for direct path

Fix toplevel tvshows path so info screen shows
Some KodiMonitor fix from Shaun
This commit is contained in:
xnappo 2015-05-26 18:12:13 -05:00
parent 698e1edb02
commit f4ea4927c3
2 changed files with 12 additions and 6 deletions

View file

@ -35,7 +35,7 @@ class Kodi_Monitor(xbmc.Monitor):
WINDOW = self.WINDOW
downloadUtils = DownloadUtils()
#player started playing an item -
if "Playlist.OnAdd" in method and addon.getSetting('useDirectPaths')=='true':
if ("Playlist.OnAdd" in method or "Player.OnPlay" in method) and addon.getSetting('useDirectPaths')=='true':
jsondata = json.loads(data)
if jsondata != None:

View file

@ -455,8 +455,17 @@ class WriteKodiVideoDB():
premieredate = premieredatelist[0]
else:
premieredate = None
path = "plugin://plugin.video.emby/tvshows/" + MBitem["Id"] + "/"
#create toplevel path as monitored source - needed for things like actors and stuff to work (no clue why)
if addon.getSetting('useDirectPaths')=='true':
playurl = MBitem["Path"].replace("\\\\", "smb://").replace("\\", "/")
#make sure that the path always ends with a slash
path = utils.convertEncoding(playurl + "/")
toplevelpathstr = path.rsplit("/",2)[1]
toplevelpath = path.replace(toplevelpathstr + "/","")
else:
path = "plugin://plugin.video.emby/tvshows/" + MBitem["Id"] + "/"
toplevelpath = "plugin://plugin.video.emby/"
#### ADD THE TV SHOW TO KODI ##############
if showid == None:
@ -469,9 +478,6 @@ class WriteKodiVideoDB():
pathid = pathid + 1
pathsql="insert into path(idPath, strPath, strContent, strScraper, noUpdate) values(?, ?, ?, ?, ?)"
cursor.execute(pathsql, (pathid,path,None,None,1))
#create toplevel path as monitored source - needed for things like actors and stuff to work (no clue why)
toplevelpath = "plugin://plugin.video.emby/"
cursor.execute("SELECT idPath as tlpathid FROM path WHERE strPath = ?",(toplevelpath,))
result = cursor.fetchone()
if result == None: