include stream_name into the playhead
This commit is contained in:
parent
8f58cb0827
commit
c05702cd4a
1 changed files with 8 additions and 7 deletions
|
@ -107,9 +107,9 @@ def remove_channel_from_database(database, scheduler, stream_id, stream_name, st
|
||||||
if stream_id == playhead['id']:
|
if stream_id == playhead['id']:
|
||||||
logger_job.warning(f'{stream_id} was playing.')
|
logger_job.warning(f'{stream_id} was playing.')
|
||||||
fallback = fallback_search(database)
|
fallback = fallback_search(database)
|
||||||
prio = 0
|
fallback_prio = 0
|
||||||
logger_job.warning(f'Source priority is reset to 0')
|
logger_job.warning(f'Source priority is reset to 0')
|
||||||
scheduler.add_job(func=exec_stream, id="fallback", args=(fallback['stream_id'], fallback['stream_name'], 0, fallback['stream_hls_url']))
|
scheduler.add_job(func=exec_stream, id="fallback", args=(fallback['stream_id'], fallback['stream_name'], fallback_prio, fallback['stream_hls_url']))
|
||||||
|
|
||||||
# Search for a fallback stream
|
# Search for a fallback stream
|
||||||
def fallback_search(database):
|
def fallback_search(database):
|
||||||
|
@ -139,9 +139,10 @@ def find_event_entry(epg, stream_name):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Update the playhead
|
# Update the playhead
|
||||||
def update_playhead(stream_id, stream_prio, stream_hls_url):
|
def update_playhead(stream_id, stream_name, stream_prio, stream_hls_url):
|
||||||
global playhead
|
global playhead
|
||||||
playhead = { "id": stream_id,
|
playhead = { "id": stream_id,
|
||||||
|
"name": stream_name,
|
||||||
"prio": stream_prio,
|
"prio": stream_prio,
|
||||||
"head": stream_hls_url }
|
"head": stream_hls_url }
|
||||||
logger_job.warning(f'Playhead position is: {str(playhead)}')
|
logger_job.warning(f'Playhead position is: {str(playhead)}')
|
||||||
|
@ -153,9 +154,9 @@ def exec_stream(stream_id, stream_name, stream_prio, stream_hls_url):
|
||||||
if stream_prio > prio:
|
if stream_prio > prio:
|
||||||
prio = stream_prio
|
prio = stream_prio
|
||||||
logger_job.warning(f'Source priority is now set to: {prio}')
|
logger_job.warning(f'Source priority is now set to: {prio}')
|
||||||
update_playhead(stream_id, stream_prio, stream_hls_url)
|
update_playhead(stream_id, stream_name, stream_prio, stream_hls_url)
|
||||||
elif stream_prio == prio:
|
elif stream_prio == prio:
|
||||||
update_playhead(stream_id, stream_prio, stream_hls_url)
|
update_playhead(stream_id, stream_name, stream_prio, stream_hls_url)
|
||||||
elif stream_prio < prio:
|
elif stream_prio < prio:
|
||||||
logger_job.warning(f'Source with higher priority ({prio}) is blocking. Skipping playhead update.')
|
logger_job.warning(f'Source with higher priority ({prio}) is blocking. Skipping playhead update.')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue