mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-12 21:26:10 +00:00
Fix the direct path handeling, if path has an issue dont add the item
This commit is contained in:
parent
ff3041d104
commit
5717aa8053
1 changed files with 12 additions and 16 deletions
|
@ -145,23 +145,19 @@ class WriteKodiVideoDB():
|
||||||
|
|
||||||
#### ADD OR UPDATE THE FILE AND PATH ###########
|
#### ADD OR UPDATE THE FILE AND PATH ###########
|
||||||
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
|
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
|
||||||
if addon.getSetting('useDirectPaths')=='true':
|
if addon.getSetting('useDirectPaths') == 'true':
|
||||||
if PlayUtils().isDirectPlay(MBitem):
|
playurl = PlayUtils().directPlay(MBitem)
|
||||||
playurl = PlayUtils().directPlay(MBitem)
|
if playurl == False:
|
||||||
#use the direct file path
|
return
|
||||||
if "\\" in playurl:
|
elif "\\" in playurl:
|
||||||
filename = playurl.rsplit("\\",1)[-1]
|
filename = playurl.rsplit("\\",1)[-1]
|
||||||
path = playurl.replace(filename,"")
|
path = playurl.replace(filename, "")
|
||||||
elif "/" in playurl:
|
elif "/" in playurl:
|
||||||
filename = playurl.rsplit("/",1)[-1]
|
filename = playurl.rsplit("/",1)[-1]
|
||||||
path = playurl.replace(filename,"")
|
path = playurl.replace(filename, "")
|
||||||
else:
|
|
||||||
#for transcoding we just use the server's streaming path because I couldn't figure out how to set the plugin path in the music DB
|
|
||||||
path = server + "/Video/%s/" %MBitem["Id"]
|
|
||||||
filename = "stream.mp4"
|
|
||||||
else:
|
else:
|
||||||
path = "plugin://plugin.video.emby/movies/%s/" % MBitem["Id"]
|
path = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/"
|
||||||
filename = "plugin://plugin.video.emby/movies/%s/?id=%s&mode=play" % (MBitem["Id"],MBitem["Id"])
|
filename = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/?id=" + MBitem["Id"] + "&mode=play"
|
||||||
|
|
||||||
#create the path
|
#create the path
|
||||||
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
|
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
|
||||||
|
|
Loading…
Reference in a new issue