diff --git a/src/main.rs b/src/main.rs index b7a0641..91cc5f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,12 +94,14 @@ fn index( } }) .collect::>(), - 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 }, )) diff --git a/templates/index.html.tera b/templates/index.html.tera index fcd91a7..9d79d62 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -29,5 +29,5 @@ {% endif %} {% if next %}Next{% endif %} {% if back %}Back{% endif %} - {{ pagination_totals }} + {% if pagination_totals %}{{ pagination_totals }}{% endif %} {% endblock content %} \ No newline at end of file