From 3339baee54eabeede0244920c5b1b3ad73db2ce7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 25 Sep 2022 13:28:53 +0200 Subject: [PATCH] fixing /live --- files/routes/static.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index d7dfcac7a..bf09bfbc4 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -492,7 +492,6 @@ if SITE == 'pcmemes.net': unit = 'year' modifier = 525600 - print(unit, flush=True) minutes = quantity * modifier actual = f'{quantity} {unit}' @@ -524,10 +523,9 @@ if SITE == 'pcmemes.net': live = sorted(live, key=lambda x: x[5], reverse=True) offline = sorted(offline, key=lambda x: x[4]) - cache.set('live', live) - cache.set('offline', offline) + if live: cache.set('live', live) + if offline: cache.set('offline', offline) - return live, offline @app.get('/live') @app.get('/logged_out/live') @@ -575,8 +573,8 @@ if SITE == 'pcmemes.net': live = sorted(live, key=lambda x: x[5], reverse=True) offline = sorted(offline, key=lambda x: x[4]) - cache.set('live', live) - cache.set('offline', offline) + if live: cache.set('live', live) + if offline: cache.set('offline', offline) return redirect('/live') @@ -597,7 +595,7 @@ if SITE == 'pcmemes.net': live = [x for x in live if x[0] != id] offline = [x for x in offline if x[0] != id] - cache.set('live', live) - cache.set('offline', offline) + if live: cache.set('live', live) + if offline: cache.set('offline', offline) return redirect('/live') \ No newline at end of file