Skip to content

Commit dc9a011

Browse files
committed
Fix container reload
1 parent 2efcbfa commit dc9a011

4 files changed

Lines changed: 27 additions & 16 deletions

File tree

resources/language/resource.language.en_gb/strings.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,7 @@ msgstr ""
163163
msgctxt "#30609"
164164
msgid "Sucessfully added to my stations!"
165165
msgstr ""
166+
167+
msgctxt "#30610"
168+
msgid "Sucessfully removed from my stations!"
169+
msgstr ""

resources/language/resource.language.pt_pt/strings.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,7 @@ msgstr "Incapaz de determinar o endereço da stream de rádio"
164164
msgctxt "#30609"
165165
msgid "Sucessfully added to my stations!"
166166
msgstr "Adicionado com sucesso à lista de estações!"
167+
168+
msgctxt "#30610"
169+
msgid "Sucessfully removed from my stations!"
170+
msgstr "Removido com sucesso da lista de estações!"

resources/lib/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def get_station_by_station_id(self, station_id, resolve_playlists=True, force_ht
117117

118118
if not station.get('streamUrl'):
119119
self.log('Unable to detect a playable stream for station')
120-
121120
return None
122121

123122
if resolve_playlists and self.__check_paylist(station['streamUrl']):

resources/lib/plugin.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
'next_page': 30605,
3636
'by_country': 30606,
3737
'error_stream': 30608,
38-
'station_add_success': 30609
38+
'station_add_success': 30609,
39+
'station_rm_success': 30610
3940
}
4041

4142
SORT_TYPES = {
@@ -211,6 +212,7 @@ def add_to_my_stations(station_id):
211212
my_stations[station_id] = station
212213
my_stations.sync()
213214
plugin.notify("Radio", _('station_add_success'), image=plugin.icon)
215+
plugin.refresh_container()
214216
else:
215217
plugin.notify("Radio", _('error_stream'), image=plugin.icon)
216218

@@ -220,6 +222,8 @@ def del_from_my_stations(station_id):
220222
if station_id in my_stations:
221223
del my_stations[station_id]
222224
my_stations.sync()
225+
plugin.notify("Radio", _('station_rm_success'), image=plugin.icon)
226+
plugin.refresh_container()
223227

224228

225229
@plugin.route('/stations/genres')
@@ -543,7 +547,7 @@ def get_stream_url(station_id):
543547

544548
def __add_stations(stations, add_custom=False, browse_more=None):
545549
items = []
546-
my_station_ids = my_stations.keys()
550+
my_station_ids = [int(item) for item in my_stations if item.isdigit()]
547551
for i, station in enumerate(stations):
548552
if station:
549553
station_id = station.get('id')
@@ -589,20 +593,20 @@ def __add_stations(stations, add_custom=False, browse_more=None):
589593
},
590594
'offscreen': True
591595
})
592-
if add_custom:
593-
items.append({
594-
'label': _('add_custom'),
595-
'path': plugin.url_for('custom_my_station', station_id='new'),
596-
})
596+
if add_custom:
597+
items.append({
598+
'label': _('add_custom'),
599+
'path': plugin.url_for('custom_my_station', station_id='new'),
600+
})
597601

598-
if browse_more:
599-
items.append({
600-
'label': '[B]%s[/B]' % _('next_page') % (browse_more['page'], browse_more['total_pages']),
601-
'path': browse_more['url'],
602-
'icon': browse_more['icon'],
603-
'fanart': browse_more['fanart'],
604-
'offscreen': True
605-
})
602+
if browse_more:
603+
items.append({
604+
'label': '[B]%s[/B]' % _('next_page') % (browse_more['page'], browse_more['total_pages']),
605+
'path': browse_more['url'],
606+
'icon': browse_more['icon'],
607+
'fanart': browse_more['fanart'],
608+
'offscreen': True
609+
})
606610

607611

608612
finish_kwargs = {

0 commit comments

Comments
 (0)