mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
hide pagination totals on empty response
This commit is contained in:
parent
3f536fd316
commit
6a9a312b00
2 changed files with 9 additions and 7 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -94,12 +94,14 @@ fn index(
|
|||
}
|
||||
})
|
||||
.collect::<Vec<R>>(),
|
||||
pagination_totals: format!(
|
||||
"Page {} / {} ({total} {} total)",
|
||||
page.unwrap_or(1),
|
||||
(total as f64 / public.default_limit as f64).ceil(),
|
||||
total.plurify(&["torrent", "torrents", "torrents"])
|
||||
),
|
||||
pagination_totals: if total > 0 {
|
||||
Some(format!(
|
||||
"Page {} / {} ({total} {} total)",
|
||||
page.unwrap_or(1),
|
||||
(total as f64 / public.default_limit as f64).ceil(),
|
||||
total.plurify(&["torrent", "torrents", "torrents"])
|
||||
))
|
||||
} else { None },
|
||||
search
|
||||
},
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue