mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 17:56:11 +00:00
fix for directplay
This commit is contained in:
parent
eccfaf983f
commit
7493e57fcb
1 changed files with 32 additions and 20 deletions
|
@ -891,36 +891,48 @@ class WriteKodiDB():
|
||||||
#use sqlite to set the filename in DB -- needed to avoid problems with resumepoints etc
|
#use sqlite to set the filename in DB -- needed to avoid problems with resumepoints etc
|
||||||
#todo --> submit PR to kodi team to get this added to the jsonrpc api
|
#todo --> submit PR to kodi team to get this added to the jsonrpc api
|
||||||
|
|
||||||
print "set filepath for id " + str(id) + " - " + filenameAndPath
|
filenameAndPath = utils.convertEncoding(filenameAndPath)
|
||||||
|
|
||||||
|
print "set filepath for id " + str(id)
|
||||||
|
|
||||||
|
if not filenameAndPath.startswith("http"):
|
||||||
if "\\" in filenameAndPath:
|
#assume direct play
|
||||||
filename = filenameAndPath.rsplit("\\",1)[-1]
|
if "\\" in filenameAndPath:
|
||||||
path = filenameAndPath.replace(filename,"")
|
filename = filenameAndPath.rsplit("\\",1)[-1]
|
||||||
elif "/" in filenameAndPath:
|
path = filenameAndPath.replace(filename,"")
|
||||||
filename = filenameAndPath.rsplit("/",1)[-1]
|
elif "/" in filenameAndPath:
|
||||||
path = filenameAndPath.replace(filename,"")
|
filename = filenameAndPath.rsplit("/",1)[-1]
|
||||||
|
path = filenameAndPath.replace(filename,"")
|
||||||
|
else:
|
||||||
|
#assume play from stream ?
|
||||||
|
filename = filenameAndPath
|
||||||
|
path = "plugin://plugin.video.emby/"
|
||||||
else:
|
else:
|
||||||
|
#assume play from stream
|
||||||
filename = filenameAndPath
|
filename = filenameAndPath
|
||||||
path = None
|
path = "plugin://plugin.video.emby/"
|
||||||
|
|
||||||
utils.logMsg("MB3 Sync","setting filename in kodi db..." + fileType + ": " + str(id))
|
utils.logMsg("MB3 Sync","setting filename in kodi db..." + fileType + ": " + str(id))
|
||||||
xbmc.sleep(sleepVal)
|
xbmc.sleep(sleepVal)
|
||||||
connection = utils.KodiSQL()
|
connection = utils.KodiSQL()
|
||||||
cursor = connection.cursor( )
|
cursor = connection.cursor( )
|
||||||
|
|
||||||
if path != None:
|
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
|
||||||
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
|
result = cursor.fetchone()
|
||||||
result = cursor.fetchone()
|
if result != None:
|
||||||
if result != None:
|
pathid = result[0]
|
||||||
pathid = result[0]
|
if result == None:
|
||||||
if result == None:
|
cursor.execute("select coalesce(max(idPath),0) as pathid from path")
|
||||||
cursor.execute("select coalesce(max(idPath),0) as pathid from path")
|
pathid = cursor.fetchone()[0]
|
||||||
pathid = cursor.fetchone()[0]
|
pathid = pathid + 1
|
||||||
pathid = pathid + 1
|
pathsql="insert into path(idPath, strPath) values(?, ?)"
|
||||||
pathsql="insert into path(idPath, strPath) values(?, ?)"
|
cursor.execute(pathsql, (pathid,path))
|
||||||
cursor.execute(pathsql, (pathid,path))
|
|
||||||
|
cursor.execute("select coalesce(max(idPath),0) as pathid from path")
|
||||||
|
pathid = cursor.fetchone()[0]
|
||||||
|
pathid = pathid + 1
|
||||||
|
pathsql="insert into path(idPath, strPath) values(?, ?)"
|
||||||
|
cursor.execute(pathsql, (pathid,path))
|
||||||
|
|
||||||
if fileType == "episode":
|
if fileType == "episode":
|
||||||
cursor.execute("SELECT idFile as fileidid FROM episode WHERE idEpisode = ?",(id,))
|
cursor.execute("SELECT idFile as fileidid FROM episode WHERE idEpisode = ?",(id,))
|
||||||
|
|
Loading…
Reference in a new issue