diff --git a/lib/clients/channels/channels.py b/lib/clients/channels/channels.py index b1d69a3..96853e9 100644 --- a/lib/clients/channels/channels.py +++ b/lib/clients/channels/channels.py @@ -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'], diff --git a/lib/clients/channels/templates.py b/lib/clients/channels/templates.py index 8b078df..0aaaaf8 100644 --- a/lib/clients/channels/templates.py +++ b/lib/clients/channels/templates.py @@ -20,7 +20,6 @@ 'jsonLineup': """{{ - "ChannelId": "{}", "CallSign": "{}", "GuideNumber": "{}", "GuideName": "{}", diff --git a/lib/clients/epg2xml.py b/lib/clients/epg2xml.py old mode 100644 new mode 100755 index 9fcad72..ffe589a --- a/lib/clients/epg2xml.py +++ b/lib/clients/epg2xml.py @@ -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'])) @@ -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']: diff --git a/lib/common/utils.py b/lib/common/utils.py index b2f0302..e974583 100644 --- a/lib/common/utils.py +++ b/lib/common/utils.py @@ -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' diff --git a/lib/resources/config_defn/clients.json b/lib/resources/config_defn/clients.json index e2cb783..98ef369 100644 --- a/lib/resources/config_defn/clients.json +++ b/lib/resources/config_defn/clients.json @@ -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", @@ -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" }