Fixed for Fanart.TV API when indexerid is 0

This commit is contained in:
echel0n 2014-12-20 09:13:56 -08:00
parent 7e8b27fcd3
commit ef9334fa6a
1 changed files with 11 additions and 10 deletions

View File

@ -1011,17 +1011,18 @@ class GenericMetadata():
try: try:
indexerid = helpers.mapIndexersToShow(show)[1] indexerid = helpers.mapIndexersToShow(show)[1]
request = Request( if indexerid:
apikey=sickbeard.FANART_API_KEY, request = Request(
id=indexerid, apikey=sickbeard.FANART_API_KEY,
ws=fanart.WS.TV, id=indexerid,
type=types[type], ws=fanart.WS.TV,
sort=fanart.SORT.POPULAR, type=types[type],
limit=fanart.LIMIT.ONE, sort=fanart.SORT.POPULAR,
) limit=fanart.LIMIT.ONE,
)
resp = request.response() resp = request.response()
return resp.values()[-1].values()[-2][-1]['url'] return resp.values()[-1].values()[-2][-1]['url']
except Exception as e: except Exception as e:
pass pass