mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
implement files counter
This commit is contained in:
parent
5c167f4852
commit
11a398e90c
2 changed files with 9 additions and 3 deletions
|
|
@ -43,6 +43,7 @@ fn index(
|
|||
indexed: String,
|
||||
magnet: String,
|
||||
size: String,
|
||||
files: String,
|
||||
torrent: Torrent,
|
||||
}
|
||||
let (total, torrents) = storage
|
||||
|
|
@ -68,6 +69,10 @@ fn index(
|
|||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||
magnet: format::magnet(&torrent.info_hash, meta.trackers.as_ref()),
|
||||
size: format::bytes(torrent.size),
|
||||
files: torrent.files.as_ref().map_or("1 file".into(), |f| {
|
||||
let l = f.len();
|
||||
format!("{l} {}", l.plurify(&["file", "files", "files"]))
|
||||
}),
|
||||
torrent,
|
||||
})
|
||||
.collect::<Vec<Row>>(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue