mirror of
https://0xacab.org/johnxina/rat.git
synced 2024-12-23 04:59:09 +00:00
Temporary remove popularity sort, Bump up aiotieba version
This commit is contained in:
parent
965c8f2cc0
commit
dd16ffe357
5
app.py
5
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')
|
||||
|
@ -1,6 +1,6 @@
|
||||
aioflask==0.4.0
|
||||
flask==2.1.3
|
||||
aiotieba==3.4.5
|
||||
aiotieba==3.5.0
|
||||
Flask-Caching
|
||||
beautifulsoup4
|
||||
requests
|
||||
|
@ -23,12 +23,13 @@
|
||||
</header>
|
||||
<div class="list">
|
||||
<div class="vlist">
|
||||
<div><a {% if sort == 0 %} class="current-sel" {% endif %}
|
||||
href="/f?kw={{ info['name'] }}&pn={{ threads.page.current_page }}&sort=0">时下热门</a></div>
|
||||
<div><a {% if sort == 1 %} class="current-sel" {% endif %}
|
||||
href="/f?kw={{ info['name'] }}&pn={{ threads.page.current_page }}&sort=1">最新发布</a></div>
|
||||
<!-- POPULAR SORT IS UNAVAILABLE -->
|
||||
<!-- <div><a {% if sort == 0 %} class="current-sel" {% endif %}
|
||||
href="/f?kw={{ info['name'] }}&pn={{ threads.page.current_page }}&sort=0">时下热门</a></div> -->
|
||||
<div><a {% if sort == 5 %} class="current-sel" {% endif %}
|
||||
href="/f?kw={{ info['name'] }}&pn={{ threads.page.current_page }}&sort=5">最新回复</a></div>
|
||||
href="/f?kw={{ info['name'] }}&sort=5">最新回复</a></div>
|
||||
<div><a {% if sort == 1 %} class="current-sel" {% endif %}
|
||||
href="/f?kw={{ info['name'] }}&sort=1">最新发布</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
|
Loading…
Reference in New Issue
Block a user