From ccda45a45234cf4b71b8746778a1d4382ace1f4a Mon Sep 17 00:00:00 2001 From: ElegantMonkey Date: Wed, 17 May 2017 12:24:53 -0300 Subject: [PATCH] Show Unknown seed/leech count on LastScrape == NULL, show scrape time Instead of showing 0/0/0 when the torrent hasn't been scraped (which may be misleading), show "Unknown", and also show when the torrent was last scraped on the view torrent page. --- templates/home.html | 4 ++++ templates/view.html | 6 ++++++ translations/en-us.all.json | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/templates/home.html b/templates/home.html index e4c9b131..b1c9f586 100644 --- a/templates/home.html +++ b/templates/home.html @@ -46,9 +46,13 @@ + {{if .LastScrape.IsZero}} + {{T "unknown"}} + {{else}} {{.Seeders}} {{.Leechers}} {{.Completed}} + {{end}} {{.Date}} {{.Filesize}} diff --git a/templates/view.html b/templates/view.html index b47375a5..f92af7f2 100644 --- a/templates/view.html +++ b/templates/view.html @@ -76,9 +76,15 @@
{{T "completed"}}
+ {{if .LastScrape.IsZero}} +
{{T "unknown"}}
+ {{else}}
{{.Seeders}}
{{.Leechers}}
{{.Completed}}
+
{{T "last_scraped"}}
+
{{.LastScrape.Format (Ts "date_format")}}
+ {{end}}
diff --git a/translations/en-us.all.json b/translations/en-us.all.json index 27280841..c107c82e 100644 --- a/translations/en-us.all.json +++ b/translations/en-us.all.json @@ -746,5 +746,13 @@ { "id": "please_include_our_tracker", "translation": "Please include udp://tracker.doko.moe:6969 in your trackers." + }, + { + "id": "unknown", + "translation": "Unknown" + }, + { + "id": "last_scraped", + "translation": "Last scraped: " } ]