From a10edf750a142ea13112a52b0347fa4188ab8031 Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 6 Oct 2025 06:04:14 +0000 Subject: [PATCH] feat: add user_id index to profiles table for faster lookups --- routers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers.py b/routers.py index e1d1c73..463c84f 100644 --- a/routers.py +++ b/routers.py @@ -555,15 +555,15 @@ async def newspaper_latest(request: Request): newspapers= list(db.query("select * from newspapers order by id desc limit 10")) except IndexError: pass - + articles = [] for newspaper in newspapers: - articles = json.loads(newspaper['articles_json']) - if articles: + articles += json.loads(newspaper['articles_json']) + if len(articles) > 30: for article in articles: for key, value in article.items(): - article[key] = str(value).strip() + article[key] = str(value).strip().replace(' ', '') return templates.TemplateResponse("newspaper_view.html", { "request": request, "newspaper": newspaper,