3434@plugin .route ('/' )
3535def root ():
3636 items = [
37- (plugin .url_for (live ), ListItem ("Direkte" ), True ),
37+ (plugin .url_for (live_tv ), ListItem ("Direkte TV" ), True ),
38+ (plugin .url_for (live_radio ), ListItem ("Direkte radio" ), True ),
3839 (plugin .url_for (recommended ), ListItem ("Anbefalt" ), True ),
3940 (plugin .url_for (popular ), ListItem ("Mest sett" ), True ),
4041 (plugin .url_for (mostrecent ), ListItem ("Sist sendt" ), True ),
@@ -45,8 +46,8 @@ def root():
4546 endOfDirectory (plugin .handle )
4647
4748
48- @plugin .route ('/live ' )
49- def live ():
49+ @plugin .route ('/live_tv ' )
50+ def live_tv ():
5051 for ch in nrktv .channels ():
5152 li = ListItem (ch .title )
5253 li .setProperty ('mimetype' , "application/vnd.apple.mpegurl" )
@@ -58,12 +59,17 @@ def live():
5859 addDirectoryItem (plugin .handle ,
5960 plugin .url_for (live_resolve , ch .manifest .split ('/' )[- 1 ]), li , False )
6061
62+ endOfDirectory (plugin .handle )
63+
64+
65+ @plugin .route ('/live_radio' )
66+ def live_radio ():
6167 for rd in nrktv .radios ():
6268 li = ListItem (rd .title )
6369 li .setProperty ('mimetype' , "audio/mpeg" )
6470 li .setProperty ('isplayable' , 'true' )
6571 li .setArt ({'thumb' : rd .thumb , 'fanart' : rd .fanart })
66- li .setInfo ('video' , {'title' : ch .title })
72+ li .setInfo ('video' , {'title' : rd .title })
6773 li .addStreamInfo ('audio' , {'codec' : 'aac' , 'channels' : 2 })
6874 addDirectoryItem (plugin .handle ,
6975 plugin .url_for (live_resolve , rd .manifest .split ('/' )[- 1 ]), li , False )
@@ -80,7 +86,7 @@ def live_resolve(id):
8086 setResolvedUrl (plugin .handle , success , li )
8187
8288
83- def set_steam_details (item , li ):
89+ def set_stream_details (item , li ):
8490 li .setProperty ('isplayable' , 'true' )
8591 li .addStreamInfo ('video' , {'codec' : 'h264' , 'width' : 1280 , 'height' : 720 , 'duration' : item .duration })
8692 li .addStreamInfo ('audio' , {'codec' : 'aac' , 'channels' : 2 })
@@ -112,7 +118,7 @@ def view(items, update_listing=False, urls=None):
112118 set_common_properties (item , li )
113119 playable = plugin .route_for (url ) == play
114120 if playable :
115- set_steam_details (item , li )
121+ set_stream_details (item , li )
116122 li .setInfo ('video' , {'count' : i , 'title' : item .title , 'mediatype' : 'video' })
117123 addDirectoryItem (plugin .handle , url , li , not playable , total )
118124 endOfDirectory (plugin .handle , updateListing = update_listing )
@@ -130,7 +136,7 @@ def show_episode_list(episodes):
130136 for i , item in enumerate (episodes ):
131137 li = ListItem ("%s - %s" % (item .episode , item .title ))
132138 set_common_properties (item , li )
133- set_steam_details (item , li )
139+ set_stream_details (item , li )
134140 li .setInfo ('video' , {
135141 'title' : item .title ,
136142 'count' : i ,
@@ -150,7 +156,7 @@ def show_plug_list(items):
150156 title += " (%s)" % item .episode
151157 li = ListItem (title )
152158 set_common_properties (item , li )
153- set_steam_details (item , li )
159+ set_stream_details (item , li )
154160 li .setInfo ('video' , {
155161 'title' : title ,
156162 'count' : i ,
0 commit comments