mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
sort order time desc by default
This commit is contained in:
parent
57ab9ef1f5
commit
1d64acef2c
2 changed files with 4 additions and 4 deletions
|
|
@ -48,7 +48,7 @@ fn index(
|
|||
}
|
||||
let (total, torrents) = storage
|
||||
.torrents(
|
||||
Some((Sort::Modified, Order::Asc)),
|
||||
Some((Sort::Modified, Order::Desc)),
|
||||
page.map(|p| if p > 0 { p - 1 } else { p } * storage.default_limit),
|
||||
Some(storage.default_limit),
|
||||
)
|
||||
|
|
@ -91,7 +91,7 @@ fn rss(feed: &State<Feed>, storage: &State<Storage>) -> Result<RawXml<String>, C
|
|||
let mut b = feed.transaction(1024); // @TODO
|
||||
for torrent in storage
|
||||
.torrents(
|
||||
Some((Sort::Modified, Order::Asc)),
|
||||
Some((Sort::Modified, Order::Desc)),
|
||||
None,
|
||||
Some(storage.default_limit),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub enum Sort {
|
|||
pub enum Order {
|
||||
#[default]
|
||||
Asc,
|
||||
//Desc,
|
||||
Desc,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
|
|
@ -186,7 +186,7 @@ impl Storage {
|
|||
match sort {
|
||||
Sort::Modified => match order {
|
||||
Order::Asc => b.sort_by(|a, b| a.0.cmp(&b.0)),
|
||||
//Order::Desc => b.sort_by(|a, b| b.0.cmp(&a.0)),
|
||||
Order::Desc => b.sort_by(|a, b| b.0.cmp(&a.0)),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue