@@ -356,31 +356,35 @@ def muxes_load(net_uuid_sel):
356
356
muxes_enabled = []
357
357
muxes_network = []
358
358
muxes_frequency = []
359
- for mux_n in muxes ['entries' ]:
360
- muxes_name .append (mux_n ['name' ])
361
- for mux_u in muxes ['entries' ]:
362
- muxes_uuid .append (mux_u ['uuid' ])
363
- for mux_w in muxes ['entries' ]:
364
- muxes_network .append (" in " + mux_w ['network' ])
365
- try :
366
- for mux_f in muxes ['entries' ]:
367
- muxes_frequency .append (mux_f ['frequency' ])
368
- except :
369
- for mux_f in muxes ['entries' ]:
370
- muxes_frequency .append (mux_f ['channel_number' ])
371
- muxes_full = zip (muxes_name , muxes_network ,)
372
- muxes_list = ["%s %s" % x for x in muxes_full ]
373
- muxes_frequency , muxes_list , muxes_uuid = zip (* sorted (zip (muxes_frequency , muxes_list , muxes_uuid )))
374
- create_mux = "CREATE NEW MUX"
375
- muxes_list = list (muxes_list )
376
- muxes_list .insert (0 ,create_mux )
377
- muxes_list = tuple (muxes_list )
378
- muxes_frequency = list (muxes_frequency )
379
- muxes_frequency .insert (0 ,create_mux )
380
- muxes_frequency = tuple (muxes_frequency )
381
- muxes_uuid = list (muxes_uuid )
382
- muxes_uuid .insert (0 ,create_mux )
383
- muxes_uuid = tuple (muxes_uuid )
359
+ muxes_total = muxes ['total' ]
360
+ if muxes_total > 0 :
361
+ for mux_n in muxes ['entries' ]:
362
+ muxes_name .append (mux_n ['name' ])
363
+ for mux_u in muxes ['entries' ]:
364
+ muxes_uuid .append (mux_u ['uuid' ])
365
+ for mux_w in muxes ['entries' ]:
366
+ muxes_network .append (" in " + mux_w ['network' ])
367
+ try :
368
+ for mux_f in muxes ['entries' ]:
369
+ muxes_frequency .append (mux_f ['frequency' ])
370
+ except :
371
+ for mux_f in muxes ['entries' ]:
372
+ muxes_frequency .append (mux_f ['channel_number' ])
373
+ muxes_full = zip (muxes_name , muxes_network ,)
374
+ muxes_list = ["%s %s" % x for x in muxes_full ]
375
+ muxes_frequency , muxes_list , muxes_uuid = zip (* sorted (zip (muxes_frequency , muxes_list , muxes_uuid )))
376
+ create_mux = "CREATE NEW MUX"
377
+ muxes_list = list (muxes_list )
378
+ muxes_list .insert (0 ,create_mux )
379
+ muxes_list = tuple (muxes_list )
380
+ muxes_frequency = list (muxes_frequency )
381
+ muxes_frequency .insert (0 ,create_mux )
382
+ muxes_frequency = tuple (muxes_frequency )
383
+ muxes_uuid = list (muxes_uuid )
384
+ muxes_uuid .insert (0 ,create_mux )
385
+ muxes_uuid = tuple (muxes_uuid )
386
+ else :
387
+ muxes_list = ['CREATE NEW MUX' ]
384
388
sel_mux = dialog .select ('Select a mux to configure' , list = muxes_list )
385
389
if sel_mux == 0 :
386
390
if net_class == "iptv_network" or net_class == "iptv_auto_network" :
@@ -1264,7 +1268,7 @@ def network_new():
1264
1268
net_create = requests .get (net_create_url ).json ()
1265
1269
net_uuid_sel = net_create ['uuid' ]
1266
1270
return net_uuid_sel
1267
- if sel_net_type == 5 or sel_net_type == 6 :
1271
+ if sel_net_type == 5 :
1268
1272
net_type = net_type_name [sel_net_type ]
1269
1273
net_class = net_type_class [sel_net_type ]
1270
1274
new_net_name = dialog .input ('Name of the network' , defaultt = net_type ,type = xbmcgui .INPUT_ALPHANUM )
@@ -1276,6 +1280,16 @@ def network_new():
1276
1280
net_create = requests .get (net_create_url ).json ()
1277
1281
net_uuid_sel = net_create ['uuid' ]
1278
1282
return net_uuid_sel
1283
+ if sel_net_type == 6 :
1284
+ net_type = net_type_name [sel_net_type ]
1285
+ net_class = net_type_class [sel_net_type ]
1286
+ new_net_name = dialog .input ('Name of the network' , defaultt = net_type ,type = xbmcgui .INPUT_ALPHANUM )
1287
+ if new_net_name == "" :
1288
+ new_net_name = net_type
1289
+ net_create_url = 'http://' + tvh_url + ':' + tvh_port + '/api/mpegts/network/create?class=' + net_class + '&conf={"networkname":"' + new_net_name + '","bouquet":false}'
1290
+ net_create = requests .get (net_create_url ).json ()
1291
+ net_uuid_sel = net_create ['uuid' ]
1292
+ return net_uuid_sel
1279
1293
if sel_net_type >= 7 :
1280
1294
dialog .ok ("Network Not Supported!" , "ISDB Networks are currently not supported in this addon." , "Please use the Tvheadend web interface to configure ISDB Networks." )
1281
1295
net_uuid_sel = ""
@@ -1941,7 +1955,7 @@ def epg():
1941
1955
1942
1956
@plugin .route ('/wizard' )
1943
1957
def wizard ():
1944
- start = dialog .yesno ("TVheadend Wizard - Start" , "This wizard will walk you through the initial setup for TVheadend. Running this wizard on an already configured system could cause issues." , "Do you wish to continue?" )
1958
+ start = dialog .yesno ("TVheadend Wizard - Start" , "This wizard will walk you through the initial setup for TVheadend using usb tuners . Running this wizard on an already configured system could cause issues." , "Do you wish to continue?" )
1945
1959
if not start :
1946
1960
return
1947
1961
else :
0 commit comments