Skip to content

Commit

Permalink
Added setting to include channel number in name
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky4546 committed Nov 27, 2021
1 parent 9f429fe commit cbce0db
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 25 deletions.
14 changes: 5 additions & 9 deletions lib/clients/channels/channels.py
Expand Up @@ -261,7 +261,6 @@ def update_channels(self, _namespace, _query_data):
results += '</ul><hr>'
return results


def translate_main2json(self, _name):
if _name == 'display_number':
return 'number'
Expand Down Expand Up @@ -290,18 +289,15 @@ def get_thumbnail_size(self, _thumbnail):
thumbnail_size = get_image_size.get_image_size_from_bytesio(fp, sz)
return thumbnail_size



def set_service_name(self, _sid_data):
"""
Returns the service name used to sync with the EPG channel name
"""

updated_chnum = utils.wrap_chnum(
str(_sid_data['display_number']), _sid_data['namespace'],
_sid_data['instance'], self.config)
service_name = updated_chnum + \
' ' + _sid_data['display_name']
return service_name


if self.config['epg']['epg_channel_number']:
return updated_chnum + \
' ' + _sid_data['display_name']
else:
return _sid_data['display_name']
11 changes: 6 additions & 5 deletions lib/clients/epg2xml.py
Expand Up @@ -179,11 +179,12 @@ def gen_channel_xml(self, _et_root, _channel_list):
ch_data['instance'], self.config)
c_out = EPG.sub_el(_et_root, 'channel', id=sid)

EPG.sub_el(c_out, 'display-name', _text='%s %s' %
(updated_chnum, ch_data['display_name']))
EPG.sub_el(c_out, 'display-name', _text='%s %s' %
(updated_chnum, ch_data['json']['callsign']))
EPG.sub_el(c_out, 'display-name', _text=updated_chnum)
if self.config['epg']['epg_channel_number']:
EPG.sub_el(c_out, 'display-name', _text='%s %s' %
(updated_chnum, ch_data['display_name']))
EPG.sub_el(c_out, 'display-name', _text='%s %s' %
(updated_chnum, ch_data['json']['callsign']))
EPG.sub_el(c_out, 'display-name', _text=updated_chnum)
EPG.sub_el(c_out, 'display-name', _text=ch_data['json']['callsign'])
EPG.sub_el(c_out, 'display-name', _text=ch_data['display_name'])

Expand Down
2 changes: 1 addition & 1 deletion lib/common/utils.py
Expand Up @@ -36,7 +36,7 @@

import lib.common.exceptions as exceptions

VERSION = '0.9.6.4'
VERSION = '0.9.6.5'
CABERNET_URL = 'https://github.com/cabernetwork/cabernet'
CABERNET_NAMESPACE = 'Cabernet'
DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0'
Expand Down
7 changes: 7 additions & 0 deletions lib/resources/config_defn/clients.json
Expand Up @@ -101,6 +101,13 @@
"level": 1,
"help": "TVHeadend uses specific genre to get colors on tv guide"
},
"epg_channel_number":{
"label": "Channel # in Name",
"type": "boolean",
"default": true,
"level": 2,
"help": "When true will include the channel number in the channel name for the channel list and EPG"
},
"epg_channel_icon":{
"label": "EPG Channel Icon",
"type": "boolean",
Expand Down
4 changes: 2 additions & 2 deletions plugins/provider_video_m3u/instance_defn.json
Expand Up @@ -89,14 +89,14 @@
"type": "boolean",
"default": false,
"level": 3,
"help": "When starting, will play the last segment. If VOD type stream, then enable will cause the entire video to be played from the start."
"help": "Plays all starting segments and ignores Non-VOD Segments to Start setting. Helpful when the VOD is not set in the provider stream."
},
"player-segments_to_play":{
"label": "Non-VOD Segments to Start",
"type": "integer",
"default": 2,
"level": 2,
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering."
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering. If the VOD flag is set in the stream, then setting is ignored."
},
"player-decode_url":{
"label": "Decode M3U8 URL",
Expand Down
4 changes: 2 additions & 2 deletions plugins/provider_video_plutotv/instance_defn.json
Expand Up @@ -67,14 +67,14 @@
"type": "boolean",
"default": false,
"level": 3,
"help": "When starting, will play the last segment. If VOD type stream, then enable will cause the entire video to be played from the start."
"help": "Plays all starting segments and ignores Non-VOD Segments to Start setting. Helpful when the VOD is not set in the provider stream."
},
"player-segments_to_play":{
"label": "Non-VOD Segments to Start",
"type": "integer",
"default": 2,
"level": 2,
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering."
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering. If the VOD flag is set in the stream, then setting is ignored."
},
"player-enable_url_filter":{
"label": "Enable URL Filtering",
Expand Down
4 changes: 2 additions & 2 deletions plugins/provider_video_plutotv/lib/channels.py
Expand Up @@ -46,8 +46,8 @@ def get_channels(self):
for channel_dict in ch_json:
if (channel_dict["isStitched"]
and channel_dict["visibility"] in ["everyone"]
and not channel_dict['onDemand']
and channel_dict["name"] != "Announcement"):
and channel_dict["name"] != "Announcement"
and not channel_dict['onDemand']):

hd = 0
ch_id = str(channel_dict['_id'])
Expand Down
4 changes: 2 additions & 2 deletions plugins/provider_video_ustvgo/instance_defn.json
Expand Up @@ -67,14 +67,14 @@
"type": "boolean",
"default": false,
"level": 3,
"help": "When starting, will play the last segment. If VOD type stream, then enable will cause the entire video to be played from the start."
"help": "Plays all starting segments and ignores Non-VOD Segments to Start setting. Helpful when the VOD is not set in the provider stream."
},
"player-segments_to_play":{
"label": "Non-VOD Segments to Start",
"type": "integer",
"default": 2,
"level": 2,
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering."
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering. If the VOD flag is set in the stream, then setting is ignored."
},
"player-enable_url_filter":{
"label": "Enable URL Filtering",
Expand Down
1 change: 1 addition & 0 deletions plugins/provider_video_ustvgo/lib/translations.py
Expand Up @@ -32,6 +32,7 @@

ustvgo_genres = {
"Action & Adventure": [ tvh_genres['ADVENTURE'] ],
"Arts": [ tvh_genres['CULTURE'] ],
"Business": [ tvh_genres['NEWS'] ],
"Comedy": [ tvh_genres['COMEDY'] ],
"Documentary": [ tvh_genres['DOCUMENTARY'] ],
Expand Down
4 changes: 2 additions & 2 deletions plugins/provider_video_xumo/instance_defn.json
Expand Up @@ -67,14 +67,14 @@
"type": "boolean",
"default": false,
"level": 3,
"help": "When starting, will play the last segment. If VOD type stream, then enable will cause the entire video to be played from the start."
"help": "Plays all starting segments and ignores Non-VOD Segments to Start setting. Helpful when the VOD is not set in the provider stream."
},
"player-segments_to_play":{
"label": "Non-VOD Segments to Start",
"type": "integer",
"default": 2,
"level": 2,
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering."
"help": "When starting, will play the last xxx segments. '1' means no buffering. Each increase means about 6 seconds of buffering. If the VOD flag is set in the stream, then setting is ignored."
},
"player-enable_url_filter":{
"label": "Enable URL Filtering",
Expand Down
1 change: 1 addition & 0 deletions plugins/provider_video_xumo/lib/translations.py
Expand Up @@ -53,6 +53,7 @@
"Holiday": [ tvh_genres['SPIRITUAL'] ],
"Kids": [ tvh_genres['KIDS'] ],
"Lifestyle": [ tvh_genres['CULTURE'] ],
"Local": [ tvh_genres['NEWS'] ],
"Movies": [ tvh_genres['MOVIE'] ],
"Music": [ tvh_genres['MUSIC'] ],
"News": [ tvh_genres['NEWS'] ],
Expand Down

0 comments on commit cbce0db

Please sign in to comment.