Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Change fanart api url
Browse files Browse the repository at this point in the history
  • Loading branch information
RuudBurger committed Jul 11, 2014
1 parent 32ce93d commit 0b48ad5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions couchpotato/core/media/movie/providers/info/fanarttv.py
Expand Up @@ -14,7 +14,7 @@
class FanartTV(MovieProvider):

urls = {
'api': 'http://api.fanart.tv/webservice/movie/b28b14e9be662e027cfbc7c3dd600405/%s/JSON/all/1/2'
'api': 'http://webservice.fanart.tv/v3/movies/%s?api_key=b28b14e9be662e027cfbc7c3dd600405'
}

MAX_EXTRAFANART = 20
Expand All @@ -36,9 +36,8 @@ def getArt(self, identifier = None, **kwargs):
fanart_data = self.getJsonData(url)

if fanart_data:
name, resource = fanart_data.items()[0]
log.debug('Found images for %s', name)
images = self._parseMovie(resource)
log.debug('Found images for %s', fanart_data.get('name'))
images = self._parseMovie(fanart_data)

except:
log.error('Failed getting extra art for %s: %s',
Expand Down Expand Up @@ -95,7 +94,7 @@ def _getImage(self, images):
for image in images:
if tryInt(image.get('likes')) > highscore:
highscore = tryInt(image.get('likes'))
image_url = image.get('url')
image_url = image.get('url') or image.get('href')

return image_url

Expand All @@ -118,7 +117,9 @@ def _getMultImages(self, images, n):
if tryInt(image.get('likes')) > highscore:
highscore = tryInt(image.get('likes'))
best = image
image_urls.append(best.get('url'))
url = best.get('url') or best.get('href')
if url:
image_urls.append(url)
pool.remove(best)

return image_urls
Expand Down

3 comments on commit 0b48ad5

@clinton-hall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi RuudBurger.

Kode is asking when this is likely to be merged to master?

I'm guessing their Api is taking a hammering?

@RuudBurger
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cherry-picked it to master
We still have Windows and OSX builds though, about 40% of the users.

@clinton-hall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks... I'll let him know.

Please sign in to comment.