|
50 | 50 | @plugin.route('/') |
51 | 51 | def show_root_menu(): |
52 | 52 | items = ( |
53 | | - {'label': _('local_stations'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 53 | + {'label': _('local_stations'), 'icon': plugin.icon, |
| 54 | + 'fanart': __get_plugin_fanart(), |
54 | 55 | 'path': plugin.url_for('show_local_stations')}, |
55 | | - {'label': _('editorials_recommendations'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 56 | + {'label': _('editorials_recommendations'), 'icon': plugin.icon, |
| 57 | + 'fanart': __get_plugin_fanart(), |
56 | 58 | 'path': plugin.url_for('show_recommendation_stations')}, |
57 | | - {'label': _('top_100_stations'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 59 | + {'label': _('top_100_stations'), 'icon': plugin.icon, |
| 60 | + 'fanart': __get_plugin_fanart(), |
58 | 61 | 'path': plugin.url_for('show_top_stations')}, |
59 | | - {'label': _('browse_by_genre'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 62 | + {'label': _('browse_by_genre'), 'icon': plugin.icon, |
| 63 | + 'fanart': __get_plugin_fanart(), |
60 | 64 | 'path': plugin.url_for('show_station_categories', |
61 | 65 | category_type='genre')}, |
62 | | - {'label': _('browse_by_topic'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 66 | + {'label': _('browse_by_topic'), 'icon': plugin.icon, |
| 67 | + 'fanart': __get_plugin_fanart(), |
63 | 68 | 'path': plugin.url_for('show_station_categories', |
64 | 69 | category_type='topic')}, |
65 | | - {'label': _('browse_by_country'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 70 | + {'label': _('browse_by_country'), 'icon': plugin.icon, |
| 71 | + 'fanart': __get_plugin_fanart(), |
66 | 72 | 'path': plugin.url_for('show_station_categories', |
67 | 73 | category_type='country')}, |
68 | | - {'label': _('browse_by_city'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 74 | + {'label': _('browse_by_city'), 'icon': plugin.icon, |
| 75 | + 'fanart': __get_plugin_fanart(), |
69 | 76 | 'path': plugin.url_for('show_station_categories', |
70 | 77 | category_type='city')}, |
71 | | - {'label': _('browse_by_language'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 78 | + {'label': _('browse_by_language'), 'icon': plugin.icon, |
| 79 | + 'fanart': __get_plugin_fanart(), |
72 | 80 | 'path': plugin.url_for('show_station_categories', |
73 | 81 | category_type='language')}, |
74 | | - {'label': _('search_for_station'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 82 | + {'label': _('search_for_station'), 'icon': plugin.icon, |
| 83 | + 'fanart': __get_plugin_fanart(), |
75 | 84 | 'path': plugin.url_for('search')}, |
76 | | - {'label': _('my_stations'), 'icon': plugin.icon, 'fanart': plugin.fanart, |
| 85 | + {'label': _('my_stations'), 'icon': plugin.icon, |
| 86 | + 'fanart': __get_plugin_fanart(), |
77 | 87 | 'path': plugin.url_for('show_my_stations')}, |
78 | 88 | ) |
79 | 89 | return plugin.finish(items) |
@@ -191,7 +201,7 @@ def get_stream_url(station_id): |
191 | 201 | path=stream_url, |
192 | 202 | icon=station['thumbnail'], |
193 | 203 | thumbnail=station['thumbnail'], |
194 | | - fanart=plugin.fanart |
| 204 | + fanart=__get_plugin_fanart(), |
195 | 205 | ) |
196 | 206 | ) |
197 | 207 |
|
@@ -222,7 +232,7 @@ def __add_stations(stations, add_custom=False): |
222 | 232 | items.append({ |
223 | 233 | 'label': station.get('name', ''), |
224 | 234 | 'thumbnail': station['thumbnail'], |
225 | | - 'fanart': plugin.fanart, |
| 235 | + 'fanart': __get_plugin_fanart(), |
226 | 236 | 'info': { |
227 | 237 | 'title': station.get('name', ''), |
228 | 238 | 'rating': str(station.get('rating', '0.0')), |
@@ -273,6 +283,10 @@ def __log(text): |
273 | 283 | plugin.log.info(text) |
274 | 284 |
|
275 | 285 |
|
| 286 | +def __get_plugin_fanart(): |
| 287 | + return plugin.fanart if not plugin.get_setting('hide-fanart', bool) else '' |
| 288 | + |
| 289 | + |
276 | 290 | def _(string_id): |
277 | 291 | if string_id in STRINGS: |
278 | 292 | return plugin.get_string(STRINGS[string_id]) |
|
0 commit comments