From dd16ffe35799bafcf246061a60c2bfb09c5b9cc0 Mon Sep 17 00:00:00 2001 From: John Xina Date: Thu, 13 Jul 2023 19:45:43 +0800 Subject: [PATCH] Temporary remove popularity sort, Bump up aiotieba version --- app.py | 5 ++--- requirements.txt | 2 +- templates/bar.html | 11 ++++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 768efb7..0d98efe 100644 --- a/app.py +++ b/app.py @@ -131,16 +131,15 @@ async def thread_view(tid): async def forum_view(): fname = request.args['kw'] pn = int(request.args.get('pn') or 1) - sort = int(request.args.get('sort') or 0) + sort = int(request.args.get('sort') or 5) async with aiotieba.Client() as tieba: forum_info, threads = await asyncio.gather(awaitify(find_tieba_info)(fname), - tieba.get_threads(fname, rn=50, pn=pn, sort=sort)) + tieba.get_threads(fname, pn=pn, sort=sort)) if threads.page.current_page > threads.page.total_page or pn < 1: return await render_template('error.html', msg = \ f'请求越界,本贴吧共有 { threads.page.total_page } 页' f'而您查询了第 { threads.page.current_page} 页') - return await render_template('bar.html', info=forum_info, threads=threads, sort=sort) @app.route('/home/main') diff --git a/requirements.txt b/requirements.txt index d6ac9b9..84ebd8c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aioflask==0.4.0 flask==2.1.3 -aiotieba==3.4.5 +aiotieba==3.5.0 Flask-Caching beautifulsoup4 requests diff --git a/templates/bar.html b/templates/bar.html index ae3e047..9d70aa7 100644 --- a/templates/bar.html +++ b/templates/bar.html @@ -23,12 +23,13 @@
-
时下热门
-
最新发布
+ +
最新回复
+ href="/f?kw={{ info['name'] }}&sort=5">最新回复
+
最新发布