From 495cc60a26ded6a8f817d5a8b0df5afed28c97fa Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 00:27:38 +0200 Subject: [PATCH] fix /live --- files/routes/static.py | 8 ++++---- files/templates/live.html | 29 ++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index 1b9c3656e..f52d07bee 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -492,8 +492,8 @@ if SITE == 'pcmemes.net': g.db.flush() if v.id != KIPPY_ID: send_repeatable_notification(KIPPY_ID, f"@{v.username} has added a [new YouTube channel](https://www.youtube.com/channel/{streamer.id})") - cache.delete_memoized(live_cached) - return redirect('/live') + + return render_template('live.html', v=v, live=live_cached()[0], offline=live_cached()[1], msg="Channel added successfuly!") @app.post('/live/remove') @admin_level_required(2) @@ -505,5 +505,5 @@ if SITE == 'pcmemes.net': if v.id != KIPPY_ID: send_repeatable_notification(KIPPY_ID, f"@{v.username} has removed a [YouTube channel](https://www.youtube.com/channel/{streamer.id})") g.db.delete(streamer) - cache.delete_memoized(live_cached) - return redirect('/live') \ No newline at end of file + + return render_template('live.html', v=v, live=live_cached()[0], offline=live_cached()[1], msg="Channel removed successfuly!") \ No newline at end of file diff --git a/files/templates/live.html b/files/templates/live.html index ec5a1831a..16438324a 100644 --- a/files/templates/live.html +++ b/files/templates/live.html @@ -21,15 +21,26 @@ {% if error %} - + + {% endif %} + {% if msg %} + {% endif %}