1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818#
1919from xbmcswift2 import Plugin , xbmc , listitem
20- from resources .lib .api import RadioApi , RadioApiError , PY3
20+ from resources .lib .api import RadioApi , RadioApiError
2121
2222STRINGS = {
2323 'editorials_recommendations' : 30100 ,
@@ -178,7 +178,7 @@ def custom_my_station(station_id):
178178 heading = _ ('please_enter' ) % _ (param )
179179 station [param ] = plugin .keyboard (station .get (param , '' ), heading ) or ''
180180 station_name = station .get ('name' , 'custom' )
181- station_id = station_name if PY3 else station_name . decode ( 'ascii' , 'ignore' ). encode ( 'ascii' )
181+ station_id = station_name
182182 station ['id' ] = station_id
183183 station ['is_custom' ] = '1'
184184 if station_id :
@@ -207,13 +207,13 @@ def show_genres():
207207 items = []
208208 for genre in genres :
209209 items .append ({
210- 'label' : __encode ( genre ["systemEnglish" ]) ,
210+ 'label' : genre ["systemEnglish" ],
211211 'icon' : plugin .icon ,
212212 'fanart' : __get_plugin_fanart (),
213213 'path' : plugin .url_for (
214214 'show_popular_and_az' ,
215215 category = 'genres' ,
216- value = __encode ( genre ["systemEnglish" ])
216+ value = genre ["systemEnglish" ]
217217 ),
218218 })
219219 finish_kwargs = {
@@ -229,13 +229,13 @@ def show_topics():
229229 items = []
230230 for topic in topics :
231231 items .append ({
232- 'label' : __encode ( topic ["systemEnglish" ]) ,
232+ 'label' : topic ["systemEnglish" ],
233233 'icon' : plugin .icon ,
234234 'fanart' : __get_plugin_fanart (),
235235 'path' : plugin .url_for (
236236 'show_popular_and_az' ,
237237 category = 'topics' ,
238- value = __encode ( topic ["systemEnglish" ])
238+ value = topic ["systemEnglish" ]
239239 ),
240240 })
241241 finish_kwargs = {
@@ -251,13 +251,13 @@ def show_countries():
251251 items = []
252252 for country in countries :
253253 items .append ({
254- 'label' : __encode ( country ["systemEnglish" ]) ,
254+ 'label' : country ["systemEnglish" ],
255255 'icon' : plugin .icon ,
256256 'fanart' : __get_plugin_fanart (),
257257 'path' : plugin .url_for (
258258 'show_popular_and_az' ,
259259 category = 'countries' ,
260- value = __encode ( country ["systemEnglish" ])
260+ value = country ["systemEnglish" ]
261261 ),
262262 })
263263 finish_kwargs = {
@@ -273,13 +273,13 @@ def show_languages():
273273 items = []
274274 for lang in languages :
275275 items .append ({
276- 'label' : __encode ( lang ["systemEnglish" ]) ,
276+ 'label' : lang ["systemEnglish" ],
277277 'icon' : plugin .icon ,
278278 'fanart' : __get_plugin_fanart (),
279279 'path' : plugin .url_for (
280280 'show_popular_and_az' ,
281281 category = 'languages' ,
282- value = __encode ( lang ["systemEnglish" ])
282+ value = lang ["systemEnglish" ]
283283 ),
284284 })
285285 finish_kwargs = {
@@ -317,25 +317,25 @@ def show_cities_list(option):
317317 countries = radio_api .get_countries ()
318318 for country in countries :
319319 items .append ({
320- 'label' : __encode ( country ["systemEnglish" ]) ,
320+ 'label' : country ["systemEnglish" ],
321321 'icon' : plugin .icon ,
322322 'fanart' : __get_plugin_fanart (),
323323 'path' : plugin .url_for (
324324 'show_cities_by_country' ,
325- country = __encode ( country ["systemEnglish" ]) ,
325+ country = country ["systemEnglish" ],
326326 ),
327327 })
328328 else :
329329 cities = radio_api .get_cities ()
330330 for city in cities :
331331 items .append ({
332- 'label' : __encode ( city ["systemEnglish" ]) ,
332+ 'label' : city ["systemEnglish" ],
333333 'icon' : plugin .icon ,
334334 'fanart' : __get_plugin_fanart (),
335335 'path' : plugin .url_for (
336336 'show_popular_and_az' ,
337337 category = 'cities' ,
338- value = __encode ( city ["systemEnglish" ]) ,
338+ value = city ["systemEnglish" ],
339339 ),
340340 })
341341 finish_kwargs = {
@@ -351,13 +351,13 @@ def show_cities_by_country(country):
351351 cities = radio_api .get_cities (country = country )
352352 for city in cities :
353353 items .append ({
354- 'label' : __encode ( city ["systemEnglish" ]) ,
354+ 'label' : city ["systemEnglish" ],
355355 'icon' : plugin .icon ,
356356 'fanart' : __get_plugin_fanart (),
357357 'path' : plugin .url_for (
358358 'show_popular_and_az' ,
359359 category = 'cities' ,
360- value = __encode ( city ["systemEnglish" ]) ,
360+ value = city ["systemEnglish" ],
361361 )
362362 })
363363 finish_kwargs = {
@@ -593,10 +593,6 @@ def __log(text):
593593def __get_plugin_fanart ():
594594 return plugin .fanart if not plugin .get_setting ('hide-fanart' , bool ) else ''
595595
596- def __encode (string ):
597- if PY3 :
598- return string
599- return string .encode ('utf-8' )
600596
601597def _ (string_id ):
602598 if string_id in STRINGS :
0 commit comments