mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
fixed actors in tvshows
This commit is contained in:
parent
a828c7480a
commit
4b6f192b4b
1 changed files with 20 additions and 2 deletions
|
@ -296,6 +296,7 @@ class WriteKodiDB():
|
||||||
|
|
||||||
changes = False
|
changes = False
|
||||||
|
|
||||||
|
|
||||||
#set Filename
|
#set Filename
|
||||||
playurl = PlayUtils().getPlayUrl(server, MBitem["Id"], MBitem)
|
playurl = PlayUtils().getPlayUrl(server, MBitem["Id"], MBitem)
|
||||||
#make sure that the path always ends with a slash
|
#make sure that the path always ends with a slash
|
||||||
|
@ -998,13 +999,30 @@ class WriteKodiDB():
|
||||||
connection = utils.KodiSQL()
|
connection = utils.KodiSQL()
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
|
|
||||||
#create the path
|
#create the tv show path
|
||||||
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, strContent, strScraper, noUpdate) values(?, ?, ?, ?, ?)"
|
pathsql="insert into path(idPath, strPath, strContent, strScraper, noUpdate) values(?, ?, ?, ?, ?)"
|
||||||
cursor.execute(pathsql, (pathid,path,None,None,1))
|
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)
|
||||||
|
if "\\" in path:
|
||||||
|
toplevelpathstr = path.rsplit("\\",2)[1]
|
||||||
|
toplevelpath = path.replace(toplevelpathstr + "\\","")
|
||||||
|
elif "/" in path:
|
||||||
|
toplevelpathstr = path.rsplit("/",2)[1]
|
||||||
|
toplevelpath = path.replace(toplevelpathstr + "/","")
|
||||||
|
cursor.execute("SELECT idPath as tlpathid FROM path WHERE strPath = ?",(toplevelpath,))
|
||||||
|
result = cursor.fetchone()
|
||||||
|
if result == None:
|
||||||
|
cursor.execute("select coalesce(max(idPath),0) as tlpathid from path")
|
||||||
|
tlpathid = cursor.fetchone()[0]
|
||||||
|
tlpathid = pathid + 1
|
||||||
|
pathsql="insert into path(idPath, strPath, strContent, strScraper, noUpdate) values(?, ?, ?, ?, ?)"
|
||||||
|
cursor.execute(pathsql, (tlpathid,toplevelpath,"tvshows","metadata.local",1))
|
||||||
|
|
||||||
|
|
||||||
runtime = int(timeInfo.get('Duration'))*60
|
runtime = int(timeInfo.get('Duration'))*60
|
||||||
plot = utils.convertEncoding(API().getOverview(MBitem))
|
plot = utils.convertEncoding(API().getOverview(MBitem))
|
||||||
thumb = "<thumb>" + API().getArtwork(MBitem, "Primary") + "</thumb>"
|
thumb = "<thumb>" + API().getArtwork(MBitem, "Primary") + "</thumb>"
|
||||||
|
@ -1243,7 +1261,7 @@ class WriteKodiDB():
|
||||||
Name = person.get("Name")
|
Name = person.get("Name")
|
||||||
Role = person.get("Role")
|
Role = person.get("Role")
|
||||||
actorid = None
|
actorid = None
|
||||||
Thumb = downloadUtils.imageUrl(person.get("Id"), "Primary", 0, 400, 400)
|
Thumb = "<thumb>" + downloadUtils.imageUrl(person.get("Id"), "Primary", 0, 400, 400) + "</thumb>"
|
||||||
cursor.execute("SELECT idActor as actorid FROM actors WHERE strActor = ?",(Name,))
|
cursor.execute("SELECT idActor as actorid FROM actors WHERE strActor = ?",(Name,))
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
if result != None:
|
if result != None:
|
||||||
|
|
Loading…
Reference in a new issue