From 0294957d14a3939b1920c6c80c6263b48bcc6edb Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 1 Oct 2015 03:13:39 -0500 Subject: [PATCH] Studios convert to Kodi compatible studios --- resources/lib/API.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/lib/API.py b/resources/lib/API.py index d1ad5709..93d06edd 100644 --- a/resources/lib/API.py +++ b/resources/lib/API.py @@ -78,16 +78,29 @@ class API(): try: studio = item['SeriesStudio'] - studios.append(studio) + studios.append(self.getStudio(studio)) except: try: studioArray = item['Studios'] for studio in studioArray: - studios.append(studio['Name']) + studios.append(self.getStudio(studio['Name'])) except: pass return studios + def getStudio(self, studioName): + # Convert studio for Kodi to properly detect them + studios = { + + 'abc (us)': "ABC", + 'fox (us)': "FOX", + 'mtv (us)': "MTV", + 'showcase (ca)': "Showcase", + 'wgn america': "WGN" + } + + return studios.get(studioName.lower(), studioName) + def getGenre(self,item): genre = "" genres = item.get("Genres")