Refactor the simplified playlist function

This commit is contained in:
Oscar Linderholm
2019-04-09 21:23:04 +02:00
committed by Henrik Friedrichsen
parent 0f0b2f3e2a
commit 5981b08458
4 changed files with 42 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ impl PlaylistView {
if let Some(playlist) = current {
let playlists = self.playlists.clone();
let id = playlist.meta.id.clone();
let id = playlist.id.clone();
let dialog = Dialog::text("Are you sure you want to delete this playlist?")
.padding((1, 1, 1, 0))
.title("Delete playlist")

View File

@@ -68,7 +68,7 @@ impl QueueView {
list_select.add_item("[Create new]", None);
for list in playlists.items().iter() {
list_select.add_item(list.meta.name.clone(), Some(list.meta.id.clone()));
list_select.add_item(list.name.clone(), Some(list.id.clone()));
}
list_select.set_on_submit(move |s, selected| {

View File

@@ -129,7 +129,7 @@ impl SearchView {
.playlists
.items
.iter()
.map(|sp| Playlists::process_playlist(sp, &&spotify))
.map(|sp| Playlists::process_simplified_playlist(sp, &&spotify))
.collect();
let mut r = playlists.write().unwrap();
*r = pls;