Skip to content

Commit

Permalink
Add studio information
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBMartins committed Jul 21, 2022
1 parent a78b876 commit b8b75a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,21 @@ def Update(self, metadata, media, lang, force, movie):
meta_role.role = role['character']
meta_role.photo = "http://{host}:{port}{relativeURL}".format(host=Prefs['Hostname'], port=Prefs['Port'], relativeURL=role['staff_image'])

# Add studio information
# Plex does not support multiple studios, we take the first studio found.
cast_v3 = HttpReq("api/v3/series/%s/Cast?" % aid)
for element in cast_v3:
if element['RoleName'] == "Studio":
metadata.studio = element['Staff']['Name']
break

# If there is no "Animation Work" on AniDB we use "Work"
if metadata.studio == None:
for element in cast_v3:
if element['RoleDetails'] == "Work":
metadata.studio = element['Staff']['Name']
break


if not movie:
for ep in series['eps']:
Expand Down

0 comments on commit b8b75a4

Please sign in to comment.