diff --git a/mythtv/bindings/python/MythTV/ttvdb/tvdb_api.py b/mythtv/bindings/python/MythTV/ttvdb/tvdb_api.py index 5d3a1755a73..4babb131f0e 100644 --- a/mythtv/bindings/python/MythTV/ttvdb/tvdb_api.py +++ b/mythtv/bindings/python/MythTV/ttvdb/tvdb_api.py @@ -958,30 +958,31 @@ def _parseBanners(self, sid): banners = {} for cur_banner in bannersEt.keys(): banners_info = self._getetsrc(self.config['url_seriesBannerInfo'] % (sid, cur_banner)) - for banner_info in banners_info: - bid = banner_info.get('id') - btype = banner_info.get('keyType') - btype2 = banner_info.get('resolution') - if btype is None or btype2 is None: - continue - - if btype not in banners: - banners[btype] = {} - if btype2 not in banners[btype]: - banners[btype][btype2] = {} - if bid not in banners[btype][btype2]: - banners[btype][btype2][bid] = {} - - banners[btype][btype2][bid]['bannerpath'] = banner_info['fileName'] - banners[btype][btype2][bid]['resolution'] = banner_info['resolution'] - banners[btype][btype2][bid]['subKey'] = banner_info['subKey'] - - for k, v in list(banners[btype][btype2][bid].items()): - if k.endswith("path"): - 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 + if banner_info is not None: + for banner_info in banners_info: + bid = banner_info.get('id') + btype = banner_info.get('keyType') + btype2 = banner_info.get('resolution') + if btype is None or btype2 is None: + continue + + if btype not in banners: + banners[btype] = {} + if btype2 not in banners[btype]: + banners[btype][btype2] = {} + if bid not in banners[btype][btype2]: + banners[btype][btype2][bid] = {} + + banners[btype][btype2][bid]['bannerpath'] = banner_info['fileName'] + banners[btype][btype2][bid]['resolution'] = banner_info['resolution'] + banners[btype][btype2][bid]['subKey'] = banner_info['subKey'] + + for k, v in list(banners[btype][btype2][bid].items()): + if k.endswith("path"): + 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 banners[btype]['raw'] = banners_info self._setShowData(sid, "_banners", banners)