mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Tweak priorities of commands
This commit is contained in:
parent
cd2e5efc95
commit
123f9c1e4a
@ -19,27 +19,51 @@ extension MPDClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func playTrack(at queuePos: Int) {
|
func playTrack(at queuePos: Int) {
|
||||||
enqueueCommand(command: .playTrack, userData: ["queuePos": queuePos])
|
enqueueCommand(
|
||||||
|
command: .playTrack,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["queuePos": queuePos]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func appendSong(_ song: MPDSong) {
|
func appendSong(_ song: MPDSong) {
|
||||||
enqueueCommand(command: .appendSong, userData: ["song": song])
|
enqueueCommand(
|
||||||
|
command: .appendSong,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["song": song]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeSong(at queuePos: Int) {
|
func removeSong(at queuePos: Int) {
|
||||||
enqueueCommand(command: .removeSong, userData: ["queuePos": queuePos])
|
enqueueCommand(
|
||||||
|
command: .removeSong,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["queuePos": queuePos]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func moveSongInQueue(at queuePos: Int, to newQueuePos: Int) {
|
func moveSongInQueue(at queuePos: Int, to newQueuePos: Int) {
|
||||||
enqueueCommand(command: .moveSongInQueue, userData: ["oldQueuePos": queuePos, "newQueuePos": newQueuePos])
|
enqueueCommand(
|
||||||
|
command: .moveSongInQueue,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["oldQueuePos": queuePos, "newQueuePos": newQueuePos]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addSongToQueue(songUri: String, at queuePos: Int) {
|
func addSongToQueue(songUri: String, at queuePos: Int) {
|
||||||
enqueueCommand(command: .addSongToQueue, userData: ["uri": songUri, "queuePos": queuePos])
|
enqueueCommand(
|
||||||
|
command: .addSongToQueue,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["uri": songUri, "queuePos": queuePos]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addAlbumToQueue(album: MPDAlbum, at queuePos: Int) {
|
func addAlbumToQueue(album: MPDAlbum, at queuePos: Int) {
|
||||||
enqueueCommand(command: .addAlbumToQueue, userData: ["album": album, "queuePos": queuePos])
|
enqueueCommand(
|
||||||
|
command: .addAlbumToQueue,
|
||||||
|
forceIdle: true,
|
||||||
|
userData: ["album": album, "queuePos": queuePos]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendPlayTrack(at queuePos: Int) {
|
func sendPlayTrack(at queuePos: Int) {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ extension MPDClient {
|
|||||||
) {
|
) {
|
||||||
enqueueCommand(
|
enqueueCommand(
|
||||||
command: .fetchAlbumArt,
|
command: .fetchAlbumArt,
|
||||||
|
priority: .low,
|
||||||
userData: [
|
userData: [
|
||||||
"songUri": songUri,
|
"songUri": songUri,
|
||||||
"callback": callback,
|
"callback": callback,
|
||||||
|
|||||||
@ -11,25 +11,41 @@ import mpdclient
|
|||||||
|
|
||||||
extension MPDClient {
|
extension MPDClient {
|
||||||
func playPause() {
|
func playPause() {
|
||||||
enqueueCommand(command: .playPause, priority: .veryHigh, forceIdle: true)
|
enqueueCommand(
|
||||||
|
command: .playPause,
|
||||||
|
priority: .high,
|
||||||
|
forceIdle: true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func stop() {
|
func stop() {
|
||||||
enqueueCommand(command: .stop, priority: .veryHigh, forceIdle: true)
|
enqueueCommand(
|
||||||
|
command: .stop,
|
||||||
|
priority: .high,
|
||||||
|
forceIdle: true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func prevTrack() {
|
func prevTrack() {
|
||||||
enqueueCommand(command: .prevTrack, priority: .veryHigh, forceIdle: true)
|
enqueueCommand(
|
||||||
|
command: .prevTrack,
|
||||||
|
priority: .high,
|
||||||
|
forceIdle: true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func nextTrack() {
|
func nextTrack() {
|
||||||
enqueueCommand(command: .nextTrack, priority: .veryHigh, forceIdle: true)
|
enqueueCommand(
|
||||||
|
command: .nextTrack,
|
||||||
|
priority: .high,
|
||||||
|
forceIdle: true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func seekCurrentSong(timeInSeconds: Float) {
|
func seekCurrentSong(timeInSeconds: Float) {
|
||||||
enqueueCommand(
|
enqueueCommand(
|
||||||
command: .seekCurrentSong,
|
command: .seekCurrentSong,
|
||||||
priority: .veryHigh,
|
priority: .high,
|
||||||
forceIdle: true,
|
forceIdle: true,
|
||||||
userData: ["timeInSeconds": timeInSeconds]
|
userData: ["timeInSeconds": timeInSeconds]
|
||||||
)
|
)
|
||||||
@ -38,7 +54,7 @@ extension MPDClient {
|
|||||||
func setShuffleState(shuffleState: Bool) {
|
func setShuffleState(shuffleState: Bool) {
|
||||||
enqueueCommand(
|
enqueueCommand(
|
||||||
command: .setShuffleState,
|
command: .setShuffleState,
|
||||||
priority: .veryHigh,
|
priority: .high,
|
||||||
forceIdle: true,
|
forceIdle: true,
|
||||||
userData: ["shuffleState": shuffleState]
|
userData: ["shuffleState": shuffleState]
|
||||||
)
|
)
|
||||||
@ -47,7 +63,7 @@ extension MPDClient {
|
|||||||
func setRepeatState(repeatState: Bool) {
|
func setRepeatState(repeatState: Bool) {
|
||||||
enqueueCommand(
|
enqueueCommand(
|
||||||
command: .setRepeatState,
|
command: .setRepeatState,
|
||||||
priority: .veryHigh,
|
priority: .high,
|
||||||
forceIdle: true,
|
forceIdle: true,
|
||||||
userData: ["repeatState": repeatState]
|
userData: ["repeatState": repeatState]
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user