mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
added support for Kodi Isengard
This commit is contained in:
parent
a464924f6f
commit
8ac8596d6f
1 changed files with 36 additions and 15 deletions
|
@ -1293,9 +1293,9 @@ class WriteKodiDB():
|
|||
|
||||
utils.logMsg("AddActorsToMedia", "List needs updating")
|
||||
|
||||
# xbmc.sleep(sleepVal)
|
||||
#connection = utils.KodiSQL()
|
||||
#cursor = connection.cursor()
|
||||
kodiVersion = 14
|
||||
if xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
||||
kodiVersion = 15
|
||||
|
||||
if(people != None):
|
||||
for person in people:
|
||||
|
@ -1306,17 +1306,38 @@ class WriteKodiDB():
|
|||
Role = person.get("Role")
|
||||
actorid = None
|
||||
Thumb = downloadUtils.imageUrl(person.get("Id"), "Primary", 0, 400, 400)
|
||||
if kodiVersion == 15:
|
||||
# Kodi Isengard database #
|
||||
if Thumb != None:
|
||||
Thumb = "<thumb>" + Thumb + "</thumb>"
|
||||
cursor.execute("SELECT actor_id as actorid FROM actor WHERE name = ?",(Name,))
|
||||
else:
|
||||
# Kodi Gotham or Helix database #
|
||||
cursor.execute("SELECT idActor as actorid FROM actors WHERE strActor = ?",(Name,))
|
||||
result = cursor.fetchone()
|
||||
if result != None:
|
||||
actorid = result[0]
|
||||
if actorid == None:
|
||||
if kodiVersion == 15:
|
||||
# Kodi Isengard database #
|
||||
cursor.execute("select coalesce(max(actor_id),0) as actorid from actor")
|
||||
actorid = cursor.fetchone()[0]
|
||||
actorid = actorid + 1
|
||||
peoplesql="insert into actor(actor_id, name, art_urls) values(?, ?, ?)"
|
||||
else:
|
||||
# Kodi Gotham or Helix database #
|
||||
cursor.execute("select coalesce(max(idActor),0) as actorid from actors")
|
||||
actorid = cursor.fetchone()[0]
|
||||
actorid = actorid + 1
|
||||
peoplesql="insert into actors(idActor, strActor, strThumb) values(?, ?, ?)"
|
||||
cursor.execute(peoplesql, (actorid,Name,Thumb))
|
||||
|
||||
if kodiVersion == 15:
|
||||
# Kodi Isengard database #
|
||||
peoplesql="INSERT OR REPLACE into actor_link(actor_id, media_id, media_type, role, cast_order) values(?, ?, ?, ?, ?)"
|
||||
cursor.execute(peoplesql, (actorid, id, mediatype, Role, None))
|
||||
else:
|
||||
# Kodi Gotham or Helix database #
|
||||
if mediatype == "movie":
|
||||
peoplesql="INSERT OR REPLACE into actorlinkmovie(idActor, idMovie, strRole, iOrder) values(?, ?, ?, ?)"
|
||||
if mediatype == "tvshow":
|
||||
|
|
Loading…
Reference in a new issue