Skip to content

Commit

Permalink
Merge commit '778137e67ebad0190c2d87caec908e5fcbe4c3d1' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Sanctum committed Nov 27, 2011
2 parents 3e561a6 + 778137e commit 551cd31
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion default.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _download_process(self):
elif arttypes['art_type'] == 'defaultthumb':
_download_art(self, 'poster', 'poster', arttypes['filename'], self.target_artworkdir, self.targets, arttypes['gui_string'])
elif arttypes['art_type'] == 'extrathumbs':
_download_art(self, arttypes['art_type'], 'fanart', arttypes['filename'], self.target_extrathumbsdirs, self.targets, arttypes['gui_string'])
_download_art(self, arttypes['art_type'], 'thumb', arttypes['filename'], self.target_extrathumbsdirs, self.targets, arttypes['gui_string'])
else:
_download_art(self, arttypes['art_type'], arttypes['art_type'], arttypes['filename'], self.target_artworkdir, self.targets, arttypes['gui_string'])

Expand Down
2 changes: 1 addition & 1 deletion resources/lib/fileops.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _downloadfile(self, url, filename, targetdirs, files_overwrite):
except URLError:
raise HTTPTimeout(url)
except socket.timeout, e:
raise HTTPTimeout(str(e))
raise HTTPTimeout(url)
else:
log("Downloaded successfully: %s" % filename, xbmc.LOGNOTICE)
self.downloadcount = self.downloadcount + 1
Expand Down
2 changes: 2 additions & 0 deletions resources/lib/provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def get_xml(self, url):
raise DownloadError(str(e))
except URLError:
raise HTTPTimeout(url)
except socket.timeout, e:
raise HTTPTimeout(url)


def get_image_list(self, media_id):
Expand Down
34 changes: 18 additions & 16 deletions resources/lib/provider/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):
self.name = 'TMDB'
self.api_key = '4be68d7eab1fbd1b6fd8a3b80a65a95e'
self.api_limits = True
self.url = "http://api.themoviedb.org/2.1/Movie.imdbLookup/" + language.get_abbrev() + "/xml/%s/%s"
self.url = "http://api.themoviedb.org/2.1/Movie.getImages/" + language.get_abbrev() + "/xml/%s/%s"


def get_image_list(self, media_id):
Expand All @@ -29,21 +29,23 @@ def get_image_list(self, media_id):
raise ItemNotFoundError(media_id)
else:
tree = tree.findall('images')[0]
for image in tree.findall('image'):
info = {}
info['url'] = image.get('url')
info['id'] = image.get('id')
info['type'] = ''
if image.get('type') == 'backdrop' and image.get('size') == 'original':
info['type'] = 'fanart'
elif image.get('type') == 'backdrop' and image.get('size') == 'poster':
info['type'] = 'thumb'
elif image.get('type') == 'poster' and image.get('size') == 'original':
info['type'] = 'poster'
info['height'] = int(image.get('height'))
info['width'] = int(image.get('width'))
if info:
image_list.append(info)
for imagetype in ['poster', 'backdrop']:
for image in tree.findall(imagetype):
for sizes in image:
info = {}
info['id'] = image.get('id')
info['type'] = ''
if imagetype == 'backdrop' and sizes.get('size') == 'original':
info['type'] = 'fanart'
elif imagetype == 'backdrop' and sizes.get('size') == 'poster':
info['type'] = 'thumb'
elif imagetype == 'poster' and sizes.get('size') == 'original':
info['type'] = 'poster'
info['url'] = sizes.get('url')
info['height'] = int(sizes.get('height'))
info['width'] = int(sizes.get('width'))
if info:
image_list.append(info)
if image_list == []:
raise NoFanartError(media_id)
else:
Expand Down
16 changes: 8 additions & 8 deletions resources/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def _get(self):

def _get_limit(self):
self.limit_artwork = __addon__.getSetting("limit_artwork") == 'true'
self.limit_extrafanart_max = int(__addon__.getSetting("limit_extrafanart_max").rstrip('0').rstrip('.').rstrip(','))
self.limit_extrafanart_rating = int(__addon__.getSetting("limit_extrafanart_rating").rstrip('0').rstrip('.').rstrip(','))
self.limit_extrafanart_max = int(__addon__.getSetting("limit_extrafanart_max").rstrip('0').rstrip('.'))
self.limit_extrafanart_rating = int(__addon__.getSetting("limit_extrafanart_rating").rstrip('0').rstrip('.'))
self.limit_size_moviefanart = int(__addon__.getSetting("limit_size_moviefanart"))
self.limit_size_tvshowfanart = int(__addon__.getSetting("limit_size_tvshowfanart"))
self.limit_extrathumbs = self.limit_artwork
Expand All @@ -84,12 +84,12 @@ def _get_limit(self):

### Initial startup vars
def _vars(self):
self.failcount = 0
self.failthreshold = 3
self.xmlfailthreshold = 5
self.api_timedelay = 5
self.mediatype = ''
self.medianame = ''
self.failcount = 0
self.failthreshold = 3
self.xmlfailthreshold = 5
self.api_timedelay = 5
self.mediatype = ''
self.medianame = ''
self.count_tvshow_extrafanart = 0
self.count_movie_extrafanart = 0
self.count_movie_extrathumbs = 0
Expand Down

1 comment on commit 551cd31

@MartijnKaijser
Copy link
Member

Choose a reason for hiding this comment

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

@paddycarey

No problems for me so if you want to do a PR to repo?

Please sign in to comment.