Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aome510 committed Jan 5, 2025
1 parent fdb2f76 commit 63a2bf7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spotify_player/src/ui/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,17 +832,16 @@ fn render_artist_context_page_windows(
// 3. Construct the page's widgets
// album table
if configs.app_config.sort_artist_albums_by_type {
albums.sort_by(|a, b| {
let get_priority = |album_type: &str| match album_type {
fn get_priority(album_type: &str) -> usize {
match album_type {
"album" => 0,
"single" => 1,
"appears_on" => 2,
"compilation" => 3,
_ => 4,
};

get_priority(&a.album_type()).cmp(&get_priority(&b.album_type()))
});
}
}
albums.sort_by_key(|a| get_priority(&a.album_type()));
}

let is_albums_active = is_active && focus_state == ArtistFocusState::Albums;
Expand Down

0 comments on commit 63a2bf7

Please sign in to comment.