mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2026-04-27 22:05:38 +00:00
Support GuestStar person type in TV episode actors
This commit is contained in:
parent
c4b751868a
commit
2ab4df5a53
2 changed files with 13 additions and 6 deletions
|
|
@ -57,10 +57,13 @@ class API(object):
|
|||
|
||||
if "People" in self.item:
|
||||
self.get_people_artwork(self.item["People"])
|
||||
|
||||
# Define which types of people are considered "actors" in a "cast".
|
||||
cast_types = ["Actor", "GuestStar"]
|
||||
|
||||
for person in self.item["People"]:
|
||||
|
||||
if person["Type"] == "Actor":
|
||||
if person["Type"] in cast_types:
|
||||
cast.append(
|
||||
{
|
||||
"name": person["Name"],
|
||||
|
|
|
|||
|
|
@ -137,11 +137,15 @@ class Kodi(object):
|
|||
cast_order = 1
|
||||
|
||||
bulk_updates = {}
|
||||
|
||||
# Define which types of people are considered "actors" in a "cast".
|
||||
cast_types = ["Actor", "GuestStar"]
|
||||
|
||||
for person in people:
|
||||
person_id = self.get_person(person["Name"])
|
||||
person_type = person["Type"]
|
||||
|
||||
if person["Type"] == "Actor":
|
||||
if person_type in cast_types:
|
||||
sql = QU.update_actor
|
||||
role = person.get("Role")
|
||||
bulk_updates.setdefault(sql, []).append(
|
||||
|
|
@ -154,21 +158,21 @@ class Kodi(object):
|
|||
)
|
||||
cast_order += 1
|
||||
|
||||
elif person["Type"] == "Director":
|
||||
elif person_type == "Director":
|
||||
sql = QU.update_link.replace("{LinkType}", "director_link")
|
||||
bulk_updates.setdefault(sql, []).append((person_id,) + args)
|
||||
|
||||
elif person["Type"] == "Writer":
|
||||
elif person_type == "Writer":
|
||||
sql = QU.update_link.replace("{LinkType}", "writer_link")
|
||||
bulk_updates.setdefault(sql, []).append((person_id,) + args)
|
||||
|
||||
elif person["Type"] == "Artist":
|
||||
elif person_type == "Artist":
|
||||
sql = QU.insert_link_if_not_exists.replace("{LinkType}", "actor_link")
|
||||
bulk_updates.setdefault(sql, []).append(
|
||||
(person_id,) + args + (person_id,) + args
|
||||
)
|
||||
|
||||
add_thumbnail(person_id, person, person["Type"])
|
||||
add_thumbnail(person_id, person, person_type)
|
||||
|
||||
for sql, parameters in bulk_updates.items():
|
||||
self.cursor.executemany(sql, parameters)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue