From ef7ff1b9ce95dad5489c5e9655e26bb12d40dbf8 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Tue, 17 Jul 2018 05:52:54 -0600 Subject: [PATCH] Add torrent counter on profile page (#409) (#513) --- nyaa/templates/user.html | 3 +++ nyaa/torrents.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nyaa/templates/user.html b/nyaa/templates/user.html index 21b59ad..700db70 100644 --- a/nyaa/templates/user.html +++ b/nyaa/templates/user.html @@ -151,6 +151,9 @@

Browsing {{ user.username }}'{{ '' if user.username[-1] == 's' else 's' }} torrents + {% if torrent_query.total is number and not search.term: %} + ({{ torrent_query.total }}) + {% endif %}

{% include "search_results.html" %} diff --git a/nyaa/torrents.py b/nyaa/torrents.py index 42d5ce4..b5668e9 100644 --- a/nyaa/torrents.py +++ b/nyaa/torrents.py @@ -1,6 +1,6 @@ import base64 import os -from urllib.parse import urlencode, quote +from urllib.parse import quote, urlencode import flask from flask import current_app as app