mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
replace filesizeformat filter with app implementation
This commit is contained in:
parent
fc8f9dbc3a
commit
ba692f9d2a
6 changed files with 37 additions and 28 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -33,7 +33,7 @@ fn index(
|
|||
indexed: String,
|
||||
magnet: String,
|
||||
scrape: Option<scrape::Result>,
|
||||
size: usize,
|
||||
size: String,
|
||||
torrent: Torrent,
|
||||
}
|
||||
let (total, torrents) = public
|
||||
|
|
@ -83,7 +83,7 @@ fn index(
|
|||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||
scrape: scrape::get(scrape, torrent.id.0),
|
||||
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||
size: torrent.size(),
|
||||
torrent
|
||||
}),
|
||||
Err(e) => {
|
||||
|
|
@ -115,7 +115,7 @@ fn info(
|
|||
struct F {
|
||||
href: Option<String>,
|
||||
path: String,
|
||||
size: usize,
|
||||
size: String,
|
||||
}
|
||||
let torrent = Torrent::from_public(&t.bytes, t.time).map_err(|e| {
|
||||
error!("Torrent parse error: `{e}`");
|
||||
|
|
@ -143,7 +143,7 @@ fn info(
|
|||
F {
|
||||
href: public.href(&torrent.info_hash, &p),
|
||||
path: p,
|
||||
size: f.length as usize, // required by `filesizeformat` impl
|
||||
size: f.size(),
|
||||
}
|
||||
})
|
||||
.collect::<Vec<F>>()
|
||||
|
|
@ -151,7 +151,7 @@ fn info(
|
|||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||
scrape: scrape::get(scrape, i.0),
|
||||
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||
size: torrent.size(),
|
||||
torrent
|
||||
},
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue