Refactor needs_download and rename library.items to better convey usage (#466)

* Refactor

* Rename items to playlists and update error message
This commit is contained in:
André Andersson
2021-03-16 20:43:17 +01:00
committed by GitHub
parent fa6e951bff
commit 65e9887f38
4 changed files with 10 additions and 18 deletions

View File

@@ -51,7 +51,7 @@ impl ContextMenu {
let mut list_select: SelectView<Playlist> = SelectView::new();
let current_user_id = library.user_id.as_ref().unwrap();
for list in library.items().iter() {
for list in library.playlists().iter() {
if current_user_id == &list.owner_id || list.collaborative {
list_select.add_item(list.name.clone(), list.clone());
}

View File

@@ -27,8 +27,8 @@ impl PlaylistsView {
}
pub fn delete_dialog(&mut self) -> Option<Modal<Dialog>> {
let store = self.library.items();
let current = store.get(self.list.get_selected_index());
let playlists = self.library.playlists();
let current = playlists.get(self.list.get_selected_index());
if let Some(playlist) = current {
let library = self.library.clone();

View File

@@ -67,7 +67,7 @@ impl QueueView {
let mut list_select: SelectView<Option<String>> = SelectView::new().autojump();
list_select.add_item("[Create new]", None);
for list in library.items().iter() {
for list in library.playlists().iter() {
list_select.add_item(list.name.clone(), Some(list.id.clone()));
}