Skip to content

Commit

Permalink
updated Plex client interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky4546 committed Apr 1, 2023
1 parent 9f1e075 commit 8c93625
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/clients/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def get_channels_json(_config, _base_url, _namespace, _instance, _plugins):
str(sid_data['display_number']), sid_data['namespace'],
sid_data['instance'], _config)
return_json = return_json + ch_templates['jsonLineup'].format(
sid,
sid_data['json']['callsign'],
updated_chnum,
sid_data['display_name'],
Expand Down
1 change: 0 additions & 1 deletion lib/clients/channels/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

'jsonLineup':
"""{{
"ChannelId": "{}",
"CallSign": "{}",
"GuideNumber": "{}",
"GuideName": "{}",
Expand Down
25 changes: 23 additions & 2 deletions lib/clients/epg2xml.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ def gen_channel_xml(self, _et_root, _channel_list):
updated_chnum = utils.wrap_chnum(
ch_data['display_number'], ch_data['namespace'],
ch_data['instance'], self.config)
c_out = EPG.sub_el(_et_root, 'channel', id=sid)
if self.config['epg'].get('epg_add_plugin_to_channel_id'):
ch_ref = ch_data['namespace'] + '-'
else:
ch_ref = ''
if self.config['epg'].get('epg_use_channel_number'):
ch_ref += updated_chnum
else:
ch_ref += sid
c_out = EPG.sub_el(_et_root, 'channel', id=ch_ref)

EPG.sub_el(c_out, 'display-name', _text='%s %s' %
(updated_chnum, ch_data['display_name']))
Expand Down Expand Up @@ -225,10 +233,23 @@ def gen_program_xml(self, _et_root, _prog_list, _channel_list, _ns, _inst):
if skip:
continue
self.prog_processed.append(proginfo)

if self.config['epg'].get('epg_add_plugin_to_channel_id'):
ch_ref = ch_data['namespace'] + '-'
else:
ch_ref = ''
if self.config['epg'].get('epg_use_channel_number'):
ch_data = _channel_list[prog_data['channel']][0]
updated_chnum = utils.wrap_chnum(
ch_data['display_number'], ch_data['namespace'],
ch_data['instance'], self.config)
ch_ref += updated_chnum
else:
ch_ref += prog_data['channel']
prog_out = EPG.sub_el(_et_root, 'programme',
start=prog_data['start'],
stop=prog_data['stop'],
channel=prog_data['channel'])
channel=ch_ref)
if prog_data['title']:
EPG.sub_el(prog_out, 'title', lang='en', _text=prog_data['title'])
if prog_data['subtitle']:
Expand Down
2 changes: 1 addition & 1 deletion lib/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import lib.common.exceptions as exceptions

VERSION = '0.9.11.06'
VERSION = '0.9.11.07'
CABERNET_URL = 'https://github.com/cabernetwork/cabernet'
CABERNET_ID = 'cabernet'
CABERNET_REPO = 'manifest.json'
Expand Down
16 changes: 15 additions & 1 deletion lib/resources/config_defn/clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@
"level": 2,
"help": "When true will include the channel number in the channel name for the channel list and EPG"
},
"epg_use_channel_number":{
"label": "Use Channel # for Channel ID",
"type": "boolean",
"default": false,
"level": 2,
"help": "For clients like Plex, they use the channel id field in the xmltv.xml as the channel number"
},
"epg_add_plugin_to_channel_id":{
"label": "Add Plugin name to Channel ID",
"type": "boolean",
"default": false,
"level": 2,
"help": "For cases where the different provider have the same UID for channels"
},
"epg_channel_icon":{
"label": "EPG Channel Icon",
"type": "boolean",
Expand All @@ -125,7 +139,7 @@
"epg_prettyprint":{
"label": "EPG Pretty Print",
"type": "boolean",
"default": true,
"default": false,
"level": 1,
"help": "If you are having memory issues, try turning this to false"
}
Expand Down

0 comments on commit 8c93625

Please sign in to comment.