Add command to show recommendations. (#593)

* Add command to show recommendations.

This adds a command `similar selected|current` which enables searching for
track recommendations for playlists, albums as well as single tracks.

* Make sure to only send 5 seed items in total.

* Add docs for recommendation bindings to the README
This commit is contained in:
HMH
2021-09-07 15:01:06 +02:00
committed by GitHub
parent 547cd6b0ef
commit d17c66f8ad
10 changed files with 166 additions and 11 deletions

View File

@@ -258,6 +258,7 @@ impl CommandManager {
| Command::Delete
| Command::Back
| Command::Open(_)
| Command::ShowRecommendations(_)
| Command::Insert(_)
| Command::Goto(_) => Ok(None),
_ => Err("Unknown Command".into()),
@@ -390,6 +391,15 @@ impl CommandManager {
kb.insert("a".into(), Command::Goto(GotoMode::Album));
kb.insert("A".into(), Command::Goto(GotoMode::Artist));
kb.insert(
"m".into(),
Command::ShowRecommendations(TargetMode::Selected),
);
kb.insert(
"M".into(),
Command::ShowRecommendations(TargetMode::Current),
);
kb.insert("Up".into(), Command::Move(MoveMode::Up, Default::default()));
kb.insert(
"p".into(),