From cc224901e71470342e53f0a004c040e06e5ccf46 Mon Sep 17 00:00:00 2001 From: deflax Date: Thu, 6 Feb 2025 14:00:42 +0000 Subject: [PATCH] Remove the rechead from the api --- src/api/api.py | 7 ------- src/discordbot/discordbot.py | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/api/api.py b/src/api/api.py index ec1d09c..d0d8e50 100644 --- a/src/api/api.py +++ b/src/api/api.py @@ -36,7 +36,6 @@ enable_delay = 24 # Init database = {} playhead = {} -rechead = {} prio = 0 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): global prio global playhead - global rechead if stream_id in database: logger_job.warning(f'{stream_id} ({stream_name}) will be removed. Reason: {state.exec}') database.pop(stream_id) @@ -254,11 +252,6 @@ def playhead_route(): global playhead return jsonify(playhead) -@app.route('/rechead', methods=['GET']) -def rechead_route(): - global rechead - return jsonify(rechead) - @app.route('/database', methods=['GET']) def database_route(): global database diff --git a/src/discordbot/discordbot.py b/src/discordbot/discordbot.py index b029013..65c8b41 100644 --- a/src/discordbot/discordbot.py +++ b/src/discordbot/discordbot.py @@ -145,7 +145,7 @@ async def query_database(): 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)) - # Manually execute the job once immediately + # Manually execute the job immediately scheduler.get_job('announce_live_channel').modify(next_run_time=datetime.now()) # Set global rechead @@ -198,7 +198,6 @@ async def query_database(): await live_channel.send(embed=embed) logger_discord.info(f'{rec_stream_name} is offline. VOD: {video_filename_no_extension}') else: - # Send offline message only await live_channel.send('Stream is offline.') logger_discord.info('Stream is offline.')