Studios convert to Kodi compatible studios

This commit is contained in:
angelblue05 2015-10-01 03:13:39 -05:00
parent 749b39e5e7
commit 0294957d14

View file

@ -78,16 +78,29 @@ class API():
try: try:
studio = item['SeriesStudio'] studio = item['SeriesStudio']
studios.append(studio) studios.append(self.getStudio(studio))
except: except:
try: try:
studioArray = item['Studios'] studioArray = item['Studios']
for studio in studioArray: for studio in studioArray:
studios.append(studio['Name']) studios.append(self.getStudio(studio['Name']))
except: pass except: pass
return studios 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): def getGenre(self,item):
genre = "" genre = ""
genres = item.get("Genres") genres = item.get("Genres")