Fix latest pagination

This commit is contained in:
Michel Roux 2019-12-15 18:53:19 +01:00
parent dce9c4838a
commit aaf6df48cf
2 changed files with 4 additions and 5 deletions

5
app.py
View File

@ -55,9 +55,8 @@ def search():
@app.route('/latest') @app.route('/latest')
def latest(): @app.route('/latest/<int:page>')
page = request.args.get('page', 1) def latest(page=1):
torrents = [ torrents = [
Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(), Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(),
Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(), Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(),

View File

@ -70,11 +70,11 @@
<nav class="pagination is-right" role="navigation" aria-label="pagination"> <nav class="pagination is-right" role="navigation" aria-label="pagination">
{% if page > 1 %} {% 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 Previous
</a> </a>
{% endif %} {% 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 Next page
</a> </a>
<ul class="pagination-list"></ul> <ul class="pagination-list"></ul>