playback: fix broken play actions

This commit is contained in:
Alexander Capehart 2024-04-14 12:16:38 -06:00
parent 02b7acd1c5
commit c8571a4df3
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 3 additions and 1 deletions

View file

@ -267,6 +267,7 @@ constructor(
val params = commandFactory.songFromArtist(song, artist, shuffle) val params = commandFactory.songFromArtist(song, artist, shuffle)
if (params != null) { if (params != null) {
playbackManager.play(params) playbackManager.play(params)
return
} }
logD( logD(
"Cannot use given artist parameter for $song [$artist from ${song.artists}], showing choice dialog") "Cannot use given artist parameter for $song [$artist from ${song.artists}], showing choice dialog")
@ -277,6 +278,7 @@ constructor(
val params = commandFactory.songFromGenre(song, genre, shuffle) val params = commandFactory.songFromGenre(song, genre, shuffle)
if (params != null) { if (params != null) {
playbackManager.play(params) playbackManager.play(params)
return
} }
logD( logD(
"Cannot use given genre parameter for $song [$genre from ${song.genres}], showing choice dialog") "Cannot use given genre parameter for $song [$genre from ${song.genres}], showing choice dialog")

View file

@ -162,7 +162,7 @@ constructor(
sort: Sort, sort: Sort,
shuffle: ShuffleMode shuffle: ShuffleMode
): PlaybackCommand? { ): PlaybackCommand? {
if (queue.isEmpty() || song !in queue) { if (queue.isEmpty() || (song != null && song !in queue)) {
return null return null
} }
return newCommand(song, parent, sort.songs(queue), shuffle) return newCommand(song, parent, sort.songs(queue), shuffle)