Add "save/unsave album" to context menu

Fixes #964
This commit is contained in:
Henrik Friedrichsen
2022-10-22 14:20:43 +02:00
parent 0ffcb212bc
commit 1dcebeace1
2 changed files with 14 additions and 2 deletions

View File

@@ -217,8 +217,8 @@ playback depending on your desktop environment settings. Have a look at the
| <kbd>Space</kbd> | Queue track or playlist. |
| <kbd>.</kbd> | Play the selected item after the currently playing track. |
| <kbd>P</kbd> | Move to the currently playing track in the queue. |
| <kbd>S</kbd> | Save the currently playing track to your library. |
| <kbd>D</kbd> | Remove the currently playing track from your library. |
| <kbd>S</kbd> | Save the currently playing item to your library. |
| <kbd>D</kbd> | Remove the currently playing item from your library. |
| <kbd>Shift</kbd>+<kbd>P</kbd> | Toggle playback (i.e. Play/Pause). |
| <kbd>Shift</kbd>+<kbd>S</kbd> | Stop playback. |
| <kbd>Shift</kbd>+<kbd>U</kbd> | Update the library cache (tracks, artists, albums, playlists). |

View File

@@ -276,6 +276,18 @@ impl ContextMenu {
);
}
if let Some(album) = item.album(queue.clone()) {
if let Some(savestatus) = album.is_saved(library.clone()) {
content.add_item(
match savestatus {
true => "Unsave album",
false => "Save album",
},
ContextMenuAction::ToggleSavedStatus(album.as_listitem()),
);
}
}
// open detail view of artist/album
{
let library = library.clone();