mirror of
https://github.com/YGGverse/btracker-gemini.git
synced 2026-04-01 09:35:32 +00:00
add nothing text on empty result
This commit is contained in:
parent
20d9a5e573
commit
ea47c33e5a
1 changed files with 21 additions and 17 deletions
38
src/main.rs
38
src/main.rs
|
|
@ -279,23 +279,27 @@ fn list(
|
||||||
|
|
||||||
b.push("## Recent\n".into());
|
b.push("## Recent\n".into());
|
||||||
|
|
||||||
for torrent in torrents {
|
if torrents.is_empty() {
|
||||||
let i: TorrentMetaV1Owned = torrent_from_bytes(&torrent.bytes)?;
|
b.push("Nothing.\n".into())
|
||||||
b.push(format!(
|
} else {
|
||||||
"=> /{} {}",
|
for torrent in torrents {
|
||||||
i.info_hash.as_string(),
|
let i: TorrentMetaV1Owned = torrent_from_bytes(&torrent.bytes)?;
|
||||||
i.info
|
b.push(format!(
|
||||||
.name
|
"=> /{} {}",
|
||||||
.as_ref()
|
i.info_hash.as_string(),
|
||||||
.map(|n| n.to_string())
|
i.info
|
||||||
.unwrap_or_default()
|
.name
|
||||||
));
|
.as_ref()
|
||||||
b.push(format!(
|
.map(|n| n.to_string())
|
||||||
"{} • {} • {}\n",
|
.unwrap_or_default()
|
||||||
torrent.time.format(&config.format_date),
|
));
|
||||||
format::total(&i),
|
b.push(format!(
|
||||||
format::files(&i),
|
"{} • {} • {}\n",
|
||||||
))
|
torrent.time.format(&config.format_date),
|
||||||
|
format::total(&i),
|
||||||
|
format::files(&i),
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b.push("## Navigation\n".into());
|
b.push("## Navigation\n".into());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue