This commit is contained in:
JMARyA 2024-08-12 18:54:31 +02:00
parent db325e7700
commit c93f0ea403
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -29,9 +29,9 @@ pub async fn albums_route(artist_id: &str, lib: &State<Libary>) -> FallibleApiRe
fn sort_by_tracknumber(a: &serde_json::Value, b: &serde_json::Value) -> Ordering { fn sort_by_tracknumber(a: &serde_json::Value, b: &serde_json::Value) -> Ordering {
let order = (|| { let order = (|| {
Some( Some(
a.get("tracknumber")? a.get("track_number")?
.as_i64()? .as_i64()?
.cmp(&b.get("tracknumber")?.as_i64()?), .cmp(&b.get("track_number")?.as_i64()?),
) )
})(); })();
order.unwrap_or(Ordering::Equal) order.unwrap_or(Ordering::Equal)