From b8b75a4f4055880181b8fc33cec5c400664fbd04 Mon Sep 17 00:00:00 2001 From: Samuel Martins Date: Thu, 21 Jul 2022 11:41:32 +0200 Subject: [PATCH] Add studio information --- Contents/Code/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index 199a8ce..4446723 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -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']: