Skip to content

Commit 8db64f9

Browse files
committed
add channel icons reset option
1 parent d149820 commit 8db64f9

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

default.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def wizard_start():
11991199
adapter_uuid.append(adapter_x['uuid'])
12001200
for adapter_t in adapter_get:
12011201
adapter_list.append(adapter_t['text'])
1202-
sel_adapter = dialog.select('Select which adapter you would like to setup', list=adapter_list)
1202+
sel_adapter = dialog.select('Select which adapter you would like to setup first', list=adapter_list)
12031203
if sel_adapter < 0:
12041204
return
12051205
if sel_adapter >= 0:
@@ -1322,7 +1322,7 @@ def wizard_start():
13221322
map_ignore_num = map_status['ignore']
13231323
map_complete = (map_ok_num + map_fail_num + map_ignore_num)
13241324
map_total_perc = ((float(map_complete) / float(serv_total)) * 100)
1325-
dialog.ok("Wizard complete!", str(map_ok_num) + " new channels.", str(map_ignore_num) + " services ignored.", str(map_fail_num) + " services failed.")
1325+
dialog.ok("Wizard complete!", str(map_ok_num) + " new channels.", str(map_ignore_num) + " services ignored. " + str(map_fail_num) + " services failed.", "You can now enable additional tuners in the adapters menu.")
13261326

13271327
@plugin.route('/adapters')
13281328
def adapters():
@@ -1598,8 +1598,8 @@ def tvh():
15981598
ch_icon_scheme, ch_icon_scheme_key, ch_icon_scheme_val = find_param_dict(tvh_config_load, 'chiconscheme', 'enum')
15991599
picon_path = find_param(tvh_config_load, 'piconpath')
16001600
picon_scheme, picon_scheme_key, picon_scheme_val = find_param_dict(tvh_config_load, 'piconscheme', 'enum')
1601-
tvh_config_info_list = ["DVB scan path: " + str(dvb_scan_path), "Prefer picon: " + str(prefer_picon), "Channel icon path: " + str(ch_icon_path), "Channel icon scheme: " + str(ch_icon_scheme), "Picon path: " + str(picon_path), "Picon scheme: " + str(picon_scheme)]
1602-
# tvh_config_param_edit(dvb_scan_path, prefer_picon, ch_icon_path, ch_icon_scheme, picon_path, picon_scheme)
1601+
tvh_config_info_list = ["DVB scan path: " + str(dvb_scan_path), "Prefer picon: " + str(prefer_picon), "Channel icon path: " + str(ch_icon_path), "Channel icon scheme: " + str(ch_icon_scheme), "Picon path: " + str(picon_path), "Picon scheme: " + str(picon_scheme), "RESET ALL CHANNEL ICONS"]
1602+
param_update = ""
16031603
sel_tvh = dialog.select('Select a Tvh configuration parameter to edit', list=tvh_config_info_list)
16041604
if sel_tvh < 0:
16051605
return
@@ -1642,6 +1642,17 @@ def tvh():
16421642
if sel_picon_scheme >= 0:
16431643
picon_scheme = ch_icon_scheme_key[sel_ch_icon_scheme]
16441644
param_update = '"piconscheme":"' + str(picon_scheme) + '"'
1645+
if sel_tvh == 6:
1646+
if dialog.yesno("Channel Icons Reset", "This will reset all channel icons urls and try to match icons based on icon/picon settings.", "Are you sure you want to reset all channel icons?"):
1647+
channels_url = 'http://' + tvh_url + ':' + tvh_port + '/api/channel/grid?all=1&limit=999999999'
1648+
channels = requests.get(channels_url).json()
1649+
icon_update_list = []
1650+
for ch_u in channels['entries']:
1651+
channel_uuid = ch_u['uuid']
1652+
icon_update_list.append('{"icon":"","uuid":"' + str(ch_u['uuid']) + '"}')
1653+
icon_update = ','.join(icon_update_list)
1654+
icon_update_url = 'http://' + tvh_url + ':' + tvh_port + '/api/idnode/save?node=[' + icon_update + ']'
1655+
icon_update_save = requests.get(icon_update_url)
16451656
if param_update != "":
16461657
param_url = 'http://' + tvh_url + ':' + tvh_port + '/api/config/save?node={' + param_update + '}'
16471658
param_save = requests.get(param_url)
@@ -1720,7 +1731,7 @@ def index():
17201731
{
17211732
'label': 'Tvheadend Backend: ' + tvh_url + ':' + tvh_port,
17221733
'path': plugin.url_for(u'tvhclient'),
1723-
'thumbnail':get_icon_path('settings'),
1734+
'thumbnail':get_icon_path('server'),
17241735
})
17251736

17261737
return items

resources/icon.png

31.6 KB
Loading

0 commit comments

Comments
 (0)