mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Fix bug where playing a song or album crashes the app
Playing an album would only crash the app if the queue was empty before trying to play.
This commit is contained in:
parent
bed09eb888
commit
c201ebaab6
@ -80,6 +80,7 @@ class AlbumDetailView: NSViewController {
|
||||
|
||||
let queueLength = App.store.state.queueState.queue.count
|
||||
App.mpdClient.appendSong(song.mpdSong)
|
||||
App.mpdClient.fetchQueue()
|
||||
App.mpdClient.playTrack(at: queueLength)
|
||||
}
|
||||
|
||||
@ -89,6 +90,7 @@ class AlbumDetailView: NSViewController {
|
||||
|
||||
let queueLength = App.store.state.queueState.queue.count
|
||||
App.mpdClient.appendSong(song.mpdSong)
|
||||
App.mpdClient.fetchQueue()
|
||||
App.mpdClient.playTrack(at: queueLength)
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ extension MPDClient {
|
||||
priority: .normal,
|
||||
userData: ["songs": songs]
|
||||
)
|
||||
self.enqueueCommand(command: .fetchQueue)
|
||||
self.enqueueCommand(
|
||||
command: .playTrack,
|
||||
priority: .normal,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user