Fix latest pagination
This commit is contained in:
parent
dce9c4838a
commit
aaf6df48cf
5
app.py
5
app.py
@ -55,9 +55,8 @@ def search():
|
||||
|
||||
|
||||
@app.route('/latest')
|
||||
def latest():
|
||||
page = request.args.get('page', 1)
|
||||
|
||||
@app.route('/latest/<int:page>')
|
||||
def latest(page=1):
|
||||
torrents = [
|
||||
Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
||||
Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
||||
|
@ -70,11 +70,11 @@
|
||||
|
||||
<nav class="pagination is-right" role="navigation" aria-label="pagination">
|
||||
{% if page > 1 %}
|
||||
<a class="pagination-previous" href="{{ url_for('latest', q=request.args.get('q'), page=(page - 1)) }}">
|
||||
<a class="pagination-previous" href="{{ url_for('latest', page=(page - 1)) }}">
|
||||
Previous
|
||||
</a>
|
||||
{% endif %}
|
||||
<a class="pagination-next" href="{{ url_for('latest', q=request.args.get('q'), page=(page + 1)) }}">
|
||||
<a class="pagination-next" href="{{ url_for('latest', page=(page + 1)) }}">
|
||||
Next page
|
||||
</a>
|
||||
<ul class="pagination-list"></ul>
|
||||
|
Reference in New Issue
Block a user