Compare commits
No commits in common. "22cda2f77c7da75d173094a6cd19164767e9d007" and "49f454c5a70453c5d7f9ab9a7cd04e7895d06052" have entirely different histories.
22cda2f77c
...
49f454c5a7
1 changed files with 7 additions and 5 deletions
|
@ -50,7 +50,7 @@ def get_core_process_details(client, process_id):
|
||||||
# Process a running channel
|
# Process a running channel
|
||||||
def process_running_channel(database, scheduler, stream_id, stream_name, stream_description, stream_hls_url):
|
def process_running_channel(database, scheduler, stream_id, stream_name, stream_description, stream_hls_url):
|
||||||
if stream_id in database:
|
if stream_id in database:
|
||||||
# Skip already learned channels
|
# Skip learned channels
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -59,11 +59,12 @@ def process_running_channel(database, scheduler, stream_id, stream_name, stream_
|
||||||
stream_start = api_settings.get('start_at')
|
stream_start = api_settings.get('start_at')
|
||||||
stream_prio = api_settings.get('prio', 0)
|
stream_prio = api_settings.get('prio', 0)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Skip channels without readable meta
|
logger_job.error(e)
|
||||||
return
|
return
|
||||||
logger_job.warning(f'{stream_id} ({stream_name}) has been registered with {api_settings} ')
|
logger_job.warning(f'{stream_id} ({stream_name}) has been registered.')
|
||||||
|
|
||||||
if stream_start == "now":
|
if stream_start == "now":
|
||||||
|
logger_job.warning("Stream should start now. Preparing")
|
||||||
|
|
||||||
# Check if the stream_hls_url returns 200
|
# Check if the stream_hls_url returns 200
|
||||||
req_counter = 0
|
req_counter = 0
|
||||||
while True:
|
while True:
|
||||||
|
@ -79,6 +80,7 @@ def process_running_channel(database, scheduler, stream_id, stream_name, stream_
|
||||||
return
|
return
|
||||||
scheduler.add_job(func=exec_stream, id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url))
|
scheduler.add_job(func=exec_stream, id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url))
|
||||||
else:
|
else:
|
||||||
|
logger_job.warning(f"Stream start hour is set to {stream_start}")
|
||||||
scheduler.add_job(
|
scheduler.add_job(
|
||||||
func=exec_stream, trigger='cron', hour=stream_start, jitter=60,
|
func=exec_stream, trigger='cron', hour=stream_start, jitter=60,
|
||||||
id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url)
|
id=stream_id, args=(stream_id, stream_name, stream_prio, stream_hls_url)
|
||||||
|
@ -142,7 +144,7 @@ def update_playhead(stream_id, stream_name, stream_prio, stream_hls_url):
|
||||||
"name": stream_name,
|
"name": stream_name,
|
||||||
"prio": stream_prio,
|
"prio": stream_prio,
|
||||||
"head": stream_hls_url }
|
"head": stream_hls_url }
|
||||||
logger_job.warning(f'Playhead: {str(playhead)}')
|
logger_job.warning(f'Playhead position is: {str(playhead)}')
|
||||||
|
|
||||||
# Execute stream
|
# Execute stream
|
||||||
def exec_stream(stream_id, stream_name, stream_prio, stream_hls_url):
|
def exec_stream(stream_id, stream_name, stream_prio, stream_hls_url):
|
||||||
|
|
Loading…
Add table
Reference in a new issue