mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-02 17:33:37 +00:00
Fix for _parseactors function in theTVDB Indexer API
This commit is contained in:
parent
cfbb7678a9
commit
f247499289
1 changed files with 41 additions and 33 deletions
|
@ -728,32 +728,36 @@ class Tvdb:
|
||||||
log().debug('Getting season banners for %s' % (sid))
|
log().debug('Getting season banners for %s' % (sid))
|
||||||
bannersEt = self._getetsrc(self.config['url_seriesBanner'] % (sid))
|
bannersEt = self._getetsrc(self.config['url_seriesBanner'] % (sid))
|
||||||
banners = {}
|
banners = {}
|
||||||
for cur_banner in bannersEt['banner'] if bannersEt else []:
|
|
||||||
bid = cur_banner['id']
|
|
||||||
btype = cur_banner['bannertype']
|
|
||||||
btype2 = cur_banner['bannertype2']
|
|
||||||
if btype is None or btype2 is None:
|
|
||||||
continue
|
|
||||||
if not btype in banners:
|
|
||||||
banners[btype] = {}
|
|
||||||
if not btype2 in banners[btype]:
|
|
||||||
banners[btype][btype2] = {}
|
|
||||||
if not bid in banners[btype][btype2]:
|
|
||||||
banners[btype][btype2][bid] = {}
|
|
||||||
|
|
||||||
for k, v in cur_banner.items():
|
try:
|
||||||
if k is None or v is None:
|
for cur_banner in bannersEt['banner']:
|
||||||
|
bid = cur_banner['id']
|
||||||
|
btype = cur_banner['bannertype']
|
||||||
|
btype2 = cur_banner['bannertype2']
|
||||||
|
if btype is None or btype2 is None:
|
||||||
continue
|
continue
|
||||||
|
if not btype in banners:
|
||||||
|
banners[btype] = {}
|
||||||
|
if not btype2 in banners[btype]:
|
||||||
|
banners[btype][btype2] = {}
|
||||||
|
if not bid in banners[btype][btype2]:
|
||||||
|
banners[btype][btype2][bid] = {}
|
||||||
|
|
||||||
k, v = k.lower(), v.lower()
|
for k, v in cur_banner.items():
|
||||||
banners[btype][btype2][bid][k] = v
|
if k is None or v is None:
|
||||||
|
continue
|
||||||
|
|
||||||
for k, v in banners[btype][btype2][bid].items():
|
k, v = k.lower(), v.lower()
|
||||||
if k.endswith("path"):
|
banners[btype][btype2][bid][k] = v
|
||||||
new_key = "_%s" % (k)
|
|
||||||
log().debug("Transforming %s to %s" % (k, new_key))
|
for k, v in banners[btype][btype2][bid].items():
|
||||||
new_url = self.config['url_artworkPrefix'] % (v)
|
if k.endswith("path"):
|
||||||
banners[btype][btype2][bid][new_key] = new_url
|
new_key = "_%s" % (k)
|
||||||
|
log().debug("Transforming %s to %s" % (k, new_key))
|
||||||
|
new_url = self.config['url_artworkPrefix'] % (v)
|
||||||
|
banners[btype][btype2][bid][new_key] = new_url
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
self._setShowData(sid, "_banners", banners)
|
self._setShowData(sid, "_banners", banners)
|
||||||
|
|
||||||
|
@ -785,17 +789,21 @@ class Tvdb:
|
||||||
actorsEt = self._getetsrc(self.config['url_actorsInfo'] % (sid))
|
actorsEt = self._getetsrc(self.config['url_actorsInfo'] % (sid))
|
||||||
|
|
||||||
cur_actors = Actors()
|
cur_actors = Actors()
|
||||||
for curActorItem in actorsEt["actor"] if actorsEt else []:
|
try:
|
||||||
curActor = Actor()
|
for curActorItem in actorsEt["actor"]:
|
||||||
for k, v in curActorItem.items():
|
curActor = Actor()
|
||||||
k = k.lower()
|
for k, v in curActorItem.items():
|
||||||
if v is not None:
|
k = k.lower()
|
||||||
if k == "image":
|
if v is not None:
|
||||||
v = self.config['url_artworkPrefix'] % (v)
|
if k == "image":
|
||||||
else:
|
v = self.config['url_artworkPrefix'] % (v)
|
||||||
v = self._cleanData(v)
|
else:
|
||||||
curActor[k] = v
|
v = self._cleanData(v)
|
||||||
cur_actors.append(curActor)
|
curActor[k] = v
|
||||||
|
cur_actors.append(curActor)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
self._setShowData(sid, '_actors', cur_actors)
|
self._setShowData(sid, '_actors', cur_actors)
|
||||||
|
|
||||||
def _getShowData(self, sid, language, seriesSearch=False):
|
def _getShowData(self, sid, language, seriesSearch=False):
|
||||||
|
|
Loading…
Reference in a new issue