Use new pagination interface for artist albums

Brings along some other changes:
- Split artist albums/singles into separate panel
- Paginate artist albums/singles
- Play top tracks by artist instead of all tracks by artist

Fixes #477
This commit is contained in:
Henrik Friedrichsen
2021-04-06 14:56:41 +02:00
parent c48771770c
commit 02921752e1
4 changed files with 89 additions and 98 deletions

View File

@@ -141,7 +141,7 @@ impl<I: ListItem> View for ListView<I> {
self.scrollbar.draw(printer, |printer, i| {
// draw paginator after content
if i == content.len() {
if i == content.len() && self.can_paginate() {
let style = ColorStyle::secondary();
let max = self.pagination.max_content().unwrap();
@@ -149,7 +149,7 @@ impl<I: ListItem> View for ListView<I> {
printer.with_color(style, |printer| {
printer.print((0, 0), &buf);
});
} else {
} else if i < content.len() {
let item = &content[i];
let currently_playing = item.is_playing(self.queue.clone())
&& self.queue.get_current_index() == Some(i);