Only show playlists where the user is allowed to add tracks when trying to add tracks (#329)
* Only show playlists where the user is allowed to add tracks * Expose user_id from library and use it to reduce api calls
This commit is contained in:
@@ -38,9 +38,12 @@ impl ContextMenu {
|
||||
track: Track,
|
||||
) -> Modal<Dialog> {
|
||||
let mut list_select: SelectView<Playlist> = SelectView::new().autojump();
|
||||
let current_user_id = library.user_id.as_ref().unwrap();
|
||||
|
||||
for list in library.items().iter() {
|
||||
list_select.add_item(list.name.clone(), list.clone());
|
||||
if current_user_id == &list.owner_id || list.collaborative {
|
||||
list_select.add_item(list.name.clone(), list.clone());
|
||||
}
|
||||
}
|
||||
|
||||
list_select.set_on_submit(move |s, selected| {
|
||||
|
||||
Reference in New Issue
Block a user