961 | | for banner_info in banners_info: |
962 | | bid = banner_info.get('id') |
963 | | btype = banner_info.get('keyType') |
964 | | btype2 = banner_info.get('resolution') |
965 | | if btype is None or btype2 is None: |
966 | | continue |
967 | | |
968 | | if btype not in banners: |
969 | | banners[btype] = {} |
970 | | if btype2 not in banners[btype]: |
971 | | banners[btype][btype2] = {} |
972 | | if bid not in banners[btype][btype2]: |
973 | | banners[btype][btype2][bid] = {} |
974 | | |
975 | | banners[btype][btype2][bid]['bannerpath'] = banner_info['fileName'] |
976 | | banners[btype][btype2][bid]['resolution'] = banner_info['resolution'] |
977 | | banners[btype][btype2][bid]['subKey'] = banner_info['subKey'] |
978 | | |
979 | | for k, v in list(banners[btype][btype2][bid].items()): |
980 | | if k.endswith("path"): |
981 | | new_key = "_%s" % k |
982 | | log().debug("Transforming %s to %s" % (k, new_key)) |
983 | | new_url = self.config['url_artworkPrefix'] % v |
984 | | banners[btype][btype2][bid][new_key] = new_url |
985 | | |
986 | | banners[btype]['raw'] = banners_info |
987 | | self._setShowData(sid, "_banners", banners) |
| 961 | if banners_info is not None: |
| 962 | for banner_info in banners_info: |
| 963 | bid = banner_info.get('id') |
| 964 | btype = banner_info.get('keyType') |
| 965 | btype2 = banner_info.get('resolution') |
| 966 | if btype is None or btype2 is None: |
| 967 | continue |
| 968 | |
| 969 | if btype not in banners: |
| 970 | banners[btype] = {} |
| 971 | if btype2 not in banners[btype]: |
| 972 | banners[btype][btype2] = {} |
| 973 | if bid not in banners[btype][btype2]: |
| 974 | banners[btype][btype2][bid] = {} |
| 975 | |
| 976 | banners[btype][btype2][bid]['bannerpath'] = banner_info['fileName'] |
| 977 | banners[btype][btype2][bid]['resolution'] = banner_info['resolution'] |
| 978 | banners[btype][btype2][bid]['subKey'] = banner_info['subKey'] |
| 979 | |
| 980 | for k, v in list(banners[btype][btype2][bid].items()): |
| 981 | if k.endswith("path"): |
| 982 | new_key = "_%s" % k |
| 983 | log().debug("Transforming %s to %s" % (k, new_key)) |
| 984 | new_url = self.config['url_artworkPrefix'] % v |
| 985 | banners[btype][btype2][bid][new_key] = new_url |
| 986 | |
| 987 | banners[btype]['raw'] = banners_info |
| 988 | self._setShowData(sid, "_banners", banners) |