Remove the rechead from the api
This commit is contained in:
parent
deab92565f
commit
cc224901e7
2 changed files with 1 additions and 9 deletions
|
@ -36,7 +36,6 @@ enable_delay = 24
|
||||||
# Init
|
# Init
|
||||||
database = {}
|
database = {}
|
||||||
playhead = {}
|
playhead = {}
|
||||||
rechead = {}
|
|
||||||
prio = 0
|
prio = 0
|
||||||
|
|
||||||
with open('/config/epg.json', 'r') as epg_json:
|
with open('/config/epg.json', 'r') as epg_json:
|
||||||
|
@ -96,7 +95,6 @@ def process_running_channel(database, scheduler, stream_id, stream_name, stream_
|
||||||
def remove_channel_from_database(database, scheduler, stream_id, stream_name, state):
|
def remove_channel_from_database(database, scheduler, stream_id, stream_name, state):
|
||||||
global prio
|
global prio
|
||||||
global playhead
|
global playhead
|
||||||
global rechead
|
|
||||||
if stream_id in database:
|
if stream_id in database:
|
||||||
logger_job.warning(f'{stream_id} ({stream_name}) will be removed. Reason: {state.exec}')
|
logger_job.warning(f'{stream_id} ({stream_name}) will be removed. Reason: {state.exec}')
|
||||||
database.pop(stream_id)
|
database.pop(stream_id)
|
||||||
|
@ -254,11 +252,6 @@ def playhead_route():
|
||||||
global playhead
|
global playhead
|
||||||
return jsonify(playhead)
|
return jsonify(playhead)
|
||||||
|
|
||||||
@app.route('/rechead', methods=['GET'])
|
|
||||||
def rechead_route():
|
|
||||||
global rechead
|
|
||||||
return jsonify(rechead)
|
|
||||||
|
|
||||||
@app.route('/database', methods=['GET'])
|
@app.route('/database', methods=['GET'])
|
||||||
def database_route():
|
def database_route():
|
||||||
global database
|
global database
|
||||||
|
|
|
@ -145,7 +145,7 @@ async def query_database():
|
||||||
logger_discord.info(f'{stream_name} live stream detected!')
|
logger_discord.info(f'{stream_name} live stream detected!')
|
||||||
scheduler.add_job(func=announce_live_channel, trigger='interval', minutes=int(live_channel_update), id='announce_live_channel', args=(stream_name, stream_meta))
|
scheduler.add_job(func=announce_live_channel, trigger='interval', minutes=int(live_channel_update), id='announce_live_channel', args=(stream_name, stream_meta))
|
||||||
|
|
||||||
# Manually execute the job once immediately
|
# Manually execute the job immediately
|
||||||
scheduler.get_job('announce_live_channel').modify(next_run_time=datetime.now())
|
scheduler.get_job('announce_live_channel').modify(next_run_time=datetime.now())
|
||||||
|
|
||||||
# Set global rechead
|
# Set global rechead
|
||||||
|
@ -198,7 +198,6 @@ async def query_database():
|
||||||
await live_channel.send(embed=embed)
|
await live_channel.send(embed=embed)
|
||||||
logger_discord.info(f'{rec_stream_name} is offline. VOD: {video_filename_no_extension}')
|
logger_discord.info(f'{rec_stream_name} is offline. VOD: {video_filename_no_extension}')
|
||||||
else:
|
else:
|
||||||
# Send offline message only
|
|
||||||
await live_channel.send('Stream is offline.')
|
await live_channel.send('Stream is offline.')
|
||||||
logger_discord.info('Stream is offline.')
|
logger_discord.info('Stream is offline.')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue