For details on how to use Mopidy’s MPD server, see Mopidy-MPD.
This object is passed as the first argument to all MPD command handlers to give the command handlers access to important parts of Mopidy.
The Mopidy core API. An instance of mopidy.core.Core.
The current MpdDispatcher.
The active subsystems that have pending events.
Helper function to retrieve a playlist from its unique MPD name.
Helper function to retrieve the unique MPD playlist name from its uri.
The MPD password
Maintain map between playlists and unique playlist names to be used by MPD
The current mopidy.mpd.MpdSession.
The subsytems that we want to be notified about in idle mode.
rather incomplete with regards to data formats, both for requests and responses. Thus, we have had to talk a great deal with the the original MPD server using telnet to get the details we need to implement our own MPD server which is compatible with the numerous existing MPD clients.
The MPD protocol uses UTF-8 for encoding all data.
The MPD protocol uses \n as line terminator.
MpdCommand(name, auth_required)
Alias for field number 1
Alias for field number 0
The MPD protocol version is 0.17.0.
Decorator for connecting command handlers to command requests.
If you use named groups in the pattern, the decorated method will get the groups as keyword arguments. If the group is optional, remember to give the argument a default value.
For example, if the command is do that thing the what argument will be this thing:
@handle_request('do\ (?P<what>.+)$')
def do(what):
...
Note that the patterns are compiled with the re.VERBOSE flag. Thus, you must escape any space characters you want to match, but you’re also free to add non-escaped whitespace to format the pattern for easier reading.
Parameters: | pattern (string) – regexp pattern for matching commands |
---|
The protocol modules must be imported to get them registered in request_handlers and mpd_commands.
Set of all available commands, represented as MpdCommand objects.
Map between request matchers and request handler functions.
Pattern:
disableoutput\ "(?P<outputid>\d+)"$
musicpd.org, audio output section:
disableoutput
Turns an output off.
Pattern:
channels$
musicpd.org, client to client section:
channels
Obtain a list of all channels. The response is a list of “channel:” lines.
Pattern:
readmessages$
musicpd.org, client to client section:
readmessages
Reads messages for this client. The response is a list of “channel:” and “message:” lines.
Pattern:
sendmessage\ "(?P<channel>[A-Za-z0-9:._-]+)"\ "(?P<text>[^"]*)"$
musicpd.org, client to client section:
sendmessage {CHANNEL} {TEXT}
Send a message to the specified channel.
Pattern:
subscribe\ "(?P<channel>[A-Za-z0-9:._-]+)"$
musicpd.org, client to client section:
subscribe {NAME}
Subscribe to a channel. The channel is created if it does not exist already. The name may consist of alphanumeric ASCII characters plus underscore, dash, dot and colon.
Pattern:
command_list_begin$
musicpd.org, command list section:
To facilitate faster adding of files etc. you can pass a list of commands all at once using a command list. The command list begins with command_list_begin or command_list_ok_begin and ends with command_list_end.
It does not execute any commands until the list has ended. The return value is whatever the return for a list of commands is. On success for all commands, OK is returned. If a command fails, no more commands are executed and the appropriate ACK error is returned. If command_list_ok_begin is used, list_OK is returned for each successful command executed in the command list.
Pattern:
command_list_end$
See command_list_begin().
Pattern:
command_list_ok_begin$
See command_list_begin().
Pattern:
close$
musicpd.org, connection section:
close
Closes the connection to MPD.
Pattern:
kill$
musicpd.org, connection section:
kill
Kills MPD.
Pattern:
add\ "(?P<uri>[^"]*)"$
musicpd.org, current playlist section:
add {URI}
Adds the file URI to the playlist (directories add recursively). URI can also be a single file.
Clarifications:
Pattern:
addid\ "(?P<uri>[^"]*)"(\ "(?P<songpos>\d+)")*$
musicpd.org, current playlist section:
addid {URI} [POSITION]
Adds a song to the playlist (non-recursive) and returns the song id.
URI is always a single file or URL. For example:
addid "foo.mp3" Id: 999 OK
Clarifications:
Pattern:
clear$
musicpd.org, current playlist section:
clear
Clears the current playlist.
Pattern:
delete\ "(?P<start>\d+):(?P<end>\d+)*"$
musicpd.org, current playlist section:
delete [{POS} | {START:END}]
Deletes a song from the playlist.
Pattern:
delete\ "(?P<songpos>\d+)"$
See delete_range()
Pattern:
deleteid\ "(?P<tlid>\d+)"$
musicpd.org, current playlist section:
deleteid {SONGID}
Deletes the song SONGID from the playlist
Pattern:
move\ "(?P<start>\d+):(?P<end>\d+)*"\ "(?P<to>\d+)"$
musicpd.org, current playlist section:
move [{FROM} | {START:END}] {TO}
Moves the song at FROM or range of songs at START:END to TO in the playlist.
Pattern:
move\ "(?P<songpos>\d+)"\ "(?P<to>\d+)"$
See move_range().
Pattern:
moveid\ "(?P<tlid>\d+)"\ "(?P<to>\d+)"$
musicpd.org, current playlist section:
moveid {FROM} {TO}
Moves the song with FROM (songid) to TO (playlist index) in the playlist. If TO is negative, it is relative to the current song in the playlist (if there is one).
Pattern:
playlist$
musicpd.org, current playlist section:
playlist
Displays the current playlist.
Note
Do not use this, instead use playlistinfo.
Pattern:
playlistfind\ ("?)(?P<tag>[^"]+)\1\ "(?P<needle>[^"]+)"$
musicpd.org, current playlist section:
playlistfind {TAG} {NEEDLE}
Finds songs in the current playlist with strict matching.
GMPC:
Pattern:
playlistid$
Pattern:
playlistid\ "(?P<tlid>\d+)"$
musicpd.org, current playlist section:
playlistid {SONGID}
Displays a list of songs in the playlist. SONGID is optional and specifies a single song to display info for.
Pattern:
playlistinfo$
Pattern:
playlistinfo\ "(?P<songpos>-?\d+)"$
Pattern:
playlistinfo\ "(?P<start>\d+):(?P<end>\d+)*"$
musicpd.org, current playlist section:
playlistinfo [[SONGPOS] | [START:END]]
Displays a list of all songs in the playlist, or if the optional argument is given, displays information only for the song SONGPOS or the range of songs START:END.
ncmpc and mpc:
Pattern:
playlistsearch\ ("?)(?P<tag>\w+)\1\ "(?P<needle>[^"]+)"$
musicpd.org, current playlist section:
playlistsearch {TAG} {NEEDLE}
Searches case-sensitively for partial matches in the current playlist.
GMPC:
Pattern:
plchanges\ ("?)(?P<version>-?\d+)\1$
musicpd.org, current playlist section:
plchanges {VERSION}
Displays changed songs currently in the playlist since VERSION.
To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.
MPDroid:
Pattern:
plchangesposid\ "(?P<version>\d+)"$
musicpd.org, current playlist section:
plchangesposid {VERSION}
Displays changed songs currently in the playlist since VERSION. This function only returns the position and the id of the changed song, not the complete metadata. This is more bandwidth efficient.
To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.
Pattern:
shuffle$
Pattern:
shuffle\ "(?P<start>\d+):(?P<end>\d+)*"$
musicpd.org, current playlist section:
shuffle [START:END]
Shuffles the current playlist. START:END is optional and specifies a range of songs.
Pattern:
count\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
count {TAG} {NEEDLE}
Counts the number of songs and their total playtime in the db matching TAG exactly.
GMPC:
Pattern:
find\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
find {TYPE} {WHAT}
Finds songs in the db that are exactly WHAT. TYPE can be any tag supported by MPD, or one of the two special parameters - file to search by full path (relative to database root), and any to match against all available tags. WHAT is what to find.
GMPC:
ncmpc:
ncmpcpp:
Pattern:
findadd\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
findadd {TYPE} {WHAT}
Finds songs in the db that are exactly WHAT and adds them to current playlist. Parameters have the same meaning as for find.
Pattern:
list\
("?) # Optional quote around the field type
(?P<field>( # Field to list in the response
[Aa]lbum
| [Aa]lbumartist
| [Aa]rtist
| [Cc]omposer
| [Dd]ate
| [Gg]enre
| [Pp]erformer
))
\1 # End of optional quote around the field type
(?: # Non-capturing group for optional search query
\ # A single space
(?P<mpd_query>.*)
)?
$
musicpd.org, music database section:
list {TYPE} [ARTIST]
Lists all tags of the specified type. TYPE should be album, artist, albumartist, date, or genre.
ARTIST is an optional parameter when type is album, date, or genre. This filters the result list by an artist.
Clarifications:
The musicpd.org documentation for list is far from complete. The command also supports the following variant:
list {TYPE} {QUERY}
Where QUERY applies to all TYPE. QUERY is one or more pairs of a field name and a value. If the QUERY consists of more than one pair, the pairs are AND-ed together to find the result. Examples of valid queries and what they should return:
- list "artist" "artist" "ABBA"
List artists where the artist name is “ABBA”. Response:
Artist: ABBA OK- list "album" "artist" "ABBA"
Lists albums where the artist name is “ABBA”. Response:
Album: More ABBA Gold: More ABBA Hits Album: Absolute More Christmas Album: Gold: Greatest Hits OK- list "artist" "album" "Gold: Greatest Hits"
Lists artists where the album name is “Gold: Greatest Hits”. Response:
Artist: ABBA OK- list "artist" "artist" "ABBA" "artist" "TLC"
Lists artists where the artist name is “ABBA” and “TLC”. Should never match anything. Response:
OK
- list "date" "artist" "ABBA"
Lists dates where artist name is “ABBA”. Response:
Date: Date: 1992 Date: 1993 OK- list "date" "artist" "ABBA" "album" "Gold: Greatest Hits"
Lists dates where artist name is “ABBA” and album name is “Gold: Greatest Hits”. Response:
Date: 1992 OK- list "genre" "artist" "The Rolling Stones"
Lists genres where artist name is “The Rolling Stones”. Response:
Genre: Genre: Rock OK
GMPC:
ncmpc:
Pattern:
listall$
Pattern:
listall\ "(?P<uri>[^"]+)"$
musicpd.org, music database section:
listall [URI]
Lists all songs and directories in URI.
Pattern:
listallinfo$
Pattern:
listallinfo\ "(?P<uri>[^"]+)"$
musicpd.org, music database section:
listallinfo [URI]
Same as listall, except it also returns metadata info in the same format as lsinfo.
Pattern:
lsinfo$
Pattern:
lsinfo\ "(?P<uri>[^"]*)"$
musicpd.org, music database section:
lsinfo [URI]
Lists the contents of the directory URI.
When listing the root directory, this currently returns the list of stored playlists. This behavior is deprecated; use listplaylists instead.
MPD returns the same result, including both playlists and the files and directories located at the root level, for both lsinfo, lsinfo "", and lsinfo "/".
Pattern:
rescan$
Pattern:
rescan\ "(?P<uri>[^"]+)"$
musicpd.org, music database section:
rescan [URI]
Same as update, but also rescans unmodified files.
Pattern:
search\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
search {TYPE} {WHAT} [...]
Searches for any song that contains WHAT. Parameters have the same meaning as for find, except that search is not case sensitive.
GMPC:
does not add quotes around the field argument.
uses the undocumented field any.
searches for multiple words like this:
search any "foo" any "bar" any "baz"
ncmpc:
ncmpcpp:
Pattern:
searchadd\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
searchadd {TYPE} {WHAT} [...]
Searches for any song that contains WHAT in tag TYPE and adds them to current playlist.
Parameters have the same meaning as for find, except that search is not case sensitive.
Pattern:
searchaddpl\ "(?P<playlist_name>[^"]+)"\
(?P<mpd_query>
(?: # Non-capturing group for repeating query pairs
"? # Optional quote around the field type
(?:
[Aa]lbum
| [Aa]lbumartist
| [Aa]ny
| [Aa]rtist
| [Cc]omment
| [Cc]omposer
| [Dd]ate
| [Ff]ile
| [Ff]ilename
| [Gg]enre
| [Pp]erformer
| [Tt]itle
| [Tt]rack
)
"? # End of optional quote around the field type
\ # A single space
"[^"]*" # Matching a quoted search string
\s?
)+
)
$
musicpd.org, music database section:
searchaddpl {NAME} {TYPE} {WHAT} [...]
Searches for any song that contains WHAT in tag TYPE and adds them to the playlist named NAME.
If a playlist by that name doesn’t exist it is created.
Parameters have the same meaning as for find, except that search is not case sensitive.
Pattern:
update$
Pattern:
update\ "(?P<uri>[^"]+)"$
musicpd.org, music database section:
update [URI]
Updates the music database: find new files, remove deleted files, update modified files.
URI is a particular directory or song/file to update. If you do not specify it, everything is updated.
Prints updating_db: JOBID where JOBID is a positive number identifying the update job. You can read the current job id in the status response.
Pattern:
consume\ ("?)(?P<state>[01])\1$
musicpd.org, playback section:
consume {STATE}
Sets consume state to STATE, STATE should be 0 or 1. When consume is activated, each song played is removed from playlist.
Pattern:
crossfade\ "(?P<seconds>\d+)"$
musicpd.org, playback section:
crossfade {SECONDS}
Sets crossfading between songs.
Pattern:
next$
musicpd.org, playback section:
next
Plays next song in the playlist.
MPD’s behaviour when affected by repeat/random/single/consume:
Given a playlist of three tracks numbered 1, 2, 3, and a currently playing track c. next_track is defined at the track that will be played upon calls to next.
Tests performed on MPD 0.15.4-1ubuntu3.
repeat random single consume c = 1 c = 2 c = 3 Notes T T T T 2 3 EOPL T T T . Rand Rand Rand [1] T T . T Rand Rand Rand [4] T T . . Rand Rand Rand [4] T . T T 2 3 EOPL T . T . 2 3 1 T . . T 3 3 EOPL T . . . 2 3 1 . T T T Rand Rand Rand [3] . T T . Rand Rand Rand [3] . T . T Rand Rand Rand [2] . T . . Rand Rand Rand [2] . . T T 2 3 EOPL . . T . 2 3 EOPL . . . T 2 3 EOPL . . . . 2 3 EOPL
- When end of playlist (EOPL) is reached, the current track is unset.
- [1] When random and single is combined, next selects a track randomly at each invocation, and not just the next track in an internal prerandomized playlist.
- [2] When random is active, next will skip through all tracks in the playlist in random order, and finally EOPL is reached.
- [3] single has no effect in combination with random alone, or random and consume.
- [4] When random and repeat is active, EOPL is never reached, but the playlist is played again, in the same random order as the first time.
Pattern:
pause$
Pattern:
pause\ "(?P<state>[01])"$
musicpd.org, playback section:
pause {PAUSE}
Toggles pause/resumes playing, PAUSE is 0 or 1.
MPDroid:
Pattern:
play$
The original MPD server resumes from the paused state on play without arguments.
Pattern:
play\ ("?)(?P<songpos>-?\d+)\1$
musicpd.org, playback section:
play [SONGPOS]
Begins playing the playlist at song number SONGPOS.
Clarifications:
BitMPC:
Pattern:
playid\ ("?)(?P<tlid>-?\d+)\1$
musicpd.org, playback section:
playid [SONGID]
Begins playing the playlist at song SONGID.
Clarifications:
Pattern:
previous$
musicpd.org, playback section:
previous
Plays previous song in the playlist.
MPD’s behaviour when affected by repeat/random/single/consume:
Given a playlist of three tracks numbered 1, 2, 3, and a currently playing track c. previous_track is defined at the track that will be played upon previous calls.
Tests performed on MPD 0.15.4-1ubuntu3.
repeat random single consume c = 1 c = 2 c = 3 T T T T Rand? Rand? Rand? T T T . 3 1 2 T T . T Rand? Rand? Rand? T T . . 3 1 2 T . T T 3 1 2 T . T . 3 1 2 T . . T 3 1 2 T . . . 3 1 2 . T T T c c c . T T . c c c . T . T c c c . T . . c c c . . T T 1 1 2 . . T . 1 1 2 . . . T 1 1 2 . . . . 1 1 2
- If time_position of the current track is 15s or more, previous should do a seek to time position 0.
Pattern:
random\ ("?)(?P<state>[01])\1$
musicpd.org, playback section:
random {STATE}
Sets random state to STATE, STATE should be 0 or 1.
Pattern:
repeat\ ("?)(?P<state>[01])\1$
musicpd.org, playback section:
repeat {STATE}
Sets repeat state to STATE, STATE should be 0 or 1.
Pattern:
replay_gain_mode\ "(?P<mode>(off|track|album))"$
musicpd.org, playback section:
replay_gain_mode {MODE}
Sets the replay gain mode. One of off, track, album.
Changing the mode during playback may take several seconds, because the new settings does not affect the buffered data.
This command triggers the options idle event.
Pattern:
replay_gain_status$
musicpd.org, playback section:
replay_gain_status
Prints replay gain options. Currently, only the variable replay_gain_mode is returned.
Pattern:
seek\ ("?)(?P<songpos>\d+)\1\ ("?)(?P<seconds>\d+)\3$
musicpd.org, playback section:
seek {SONGPOS} {TIME}
Seeks to the position TIME (in seconds) of entry SONGPOS in the playlist.
Droid MPD:
Pattern:
seekcur\ "(?P<position>\d+)"$
Pattern:
seekcur\ "(?P<diff>[-+]\d+)"$
musicpd.org, playback section:
seekcur {TIME}
Seeks to the position TIME within the current song. If prefixed by ‘+’ or ‘-‘, then the time is relative to the current playing position.
Pattern:
seekid\ "(?P<tlid>\d+)"\ "(?P<seconds>\d+)"$
musicpd.org, playback section:
seekid {SONGID} {TIME}
Seeks to the position TIME (in seconds) of song SONGID.
Pattern:
setvol\ ("?)(?P<volume>[-+]*\d+)\1$
musicpd.org, playback section:
setvol {VOL}
Sets volume to VOL, the range of volume is 0-100.
Droid MPD:
Pattern:
single\ ("?)(?P<state>[01])\1$
musicpd.org, playback section:
single {STATE}
Sets single state to STATE, STATE should be 0 or 1. When single is activated, playback is stopped after current song, or song is repeated if the repeat mode is enabled.
Pattern:
commands$
musicpd.org, reflection section:
commands
Shows which commands the current user has access to.
Pattern:
config$
musicpd.org, reflection section:
config
Dumps configuration values that may be interesting for the client. This command is only permitted to “local” clients (connected via UNIX domain socket).
Pattern:
decoders$
musicpd.org, reflection section:
decoders
Print a list of decoder plugins, followed by their supported suffixes and MIME types. Example response:
plugin: mad suffix: mp3 suffix: mp2 mime_type: audio/mpeg plugin: mpcdec suffix: mpc
Clarifications:
Pattern:
notcommands$
musicpd.org, reflection section:
notcommands
Shows which commands the current user does not have access to.
Subsystems that can be registered with idle command.
Pattern:
clearerror$
musicpd.org, status section:
clearerror
Clears the current error message in status (this is also accomplished by any command that starts playback).
Pattern:
currentsong$
musicpd.org, status section:
currentsong
Displays the song info of the current song (same song that is identified in status).
Pattern:
idle$
Pattern:
idle\ (?P<subsystems>.+)$
musicpd.org, status section:
idle [SUBSYSTEMS...]
Waits until there is a noteworthy change in one or more of MPD’s subsystems. As soon as there is one, it lists all changed systems in a line in the format changed: SUBSYSTEM, where SUBSYSTEM is one of the following:
- database: the song database has been modified after update.
- update: a database update has started or finished. If the database was modified during the update, the database event is also emitted.
- stored_playlist: a stored playlist has been modified, renamed, created or deleted
- playlist: the current playlist has been modified
- player: the player has been started, stopped or seeked
- mixer: the volume has been changed
- output: an audio output has been enabled or disabled
- options: options like repeat, random, crossfade, replay gain
While a client is waiting for idle results, the server disables timeouts, allowing a client to wait for events as long as MPD runs. The idle command can be canceled by sending the command noidle (no other commands are allowed). MPD will then leave idle mode and print results immediately; might be empty at this time.
If the optional SUBSYSTEMS argument is used, MPD will only send notifications when something changed in one of the specified subsystems.
Pattern:
stats$
musicpd.org, status section:
stats
Displays statistics.
- artists: number of artists
- songs: number of albums
- uptime: daemon uptime in seconds
- db_playtime: sum of all song times in the db
- db_update: last db update in UNIX time
- playtime: time length of music played
Pattern:
status$
musicpd.org, status section:
status
Reports the current status of the player and the volume level.
- volume: 0-100 or -1
- repeat: 0 or 1
- single: 0 or 1
- consume: 0 or 1
- playlist: 31-bit unsigned integer, the playlist version number
- playlistlength: integer, the length of the playlist
- state: play, stop, or pause
- song: playlist song number of the current song stopped on or playing
- songid: playlist songid of the current song stopped on or playing
- nextsong: playlist song number of the next song to be played
- nextsongid: playlist songid of the next song to be played
- time: total time elapsed (of current playing/paused song)
- elapsed: Total time elapsed within the current song, but with higher resolution.
- bitrate: instantaneous bitrate in kbps
- xfade: crossfade in seconds
- audio: sampleRate``:bits``:channels
- updatings_db: job id
- error: if there is an error, returns message here
Pattern:
sticker\ delete\ "(?P<field>[^"]+)"\ "(?P<uri>[^"]+)"(\ "(?P<name>[^"]+)")*$
musicpd.org, sticker section:
sticker delete {TYPE} {URI} [NAME]
Deletes a sticker value from the specified object. If you do not specify a sticker name, all sticker values are deleted.
Pattern:
sticker\ find\ "(?P<field>[^"]+)"\ "(?P<uri>[^"]+)"\ "(?P<name>[^"]+)"$
musicpd.org, sticker section:
sticker find {TYPE} {URI} {NAME}
Searches the sticker database for stickers with the specified name, below the specified directory (URI). For each matching song, it prints the URI and that one sticker’s value.
Pattern:
sticker\ get\ "(?P<field>[^"]+)"\ "(?P<uri>[^"]+)"\ "(?P<name>[^"]+)"$
musicpd.org, sticker section:
sticker get {TYPE} {URI} {NAME}
Reads a sticker value for the specified object.
Pattern:
sticker\ list\ "(?P<field>[^"]+)"\ "(?P<uri>[^"]+)"$
musicpd.org, sticker section:
sticker list {TYPE} {URI}
Lists the stickers for the specified object.
Pattern:
sticker\ set\ "(?P<field>[^"]+)"\ "(?P<uri>[^"]+)"\ "(?P<name>[^"]+)"\ "(?P<value>[^"]+)"$
musicpd.org, sticker section:
sticker set {TYPE} {URI} {NAME} {VALUE}
Adds a sticker value to the specified object. If a sticker item with that name already exists, it is replaced.
Pattern:
listplaylist\ ("?)(?P<name>[^"]+)\1$
musicpd.org, stored playlists section:
listplaylist {NAME}
Lists the files in the playlist NAME.m3u.
Output format:
file: relative/path/to/file1.flac
file: relative/path/to/file2.ogg
file: relative/path/to/file3.mp3
Pattern:
listplaylistinfo\ ("?)(?P<name>[^"]+)\1$
musicpd.org, stored playlists section:
listplaylistinfo {NAME}
Lists songs in the playlist NAME.m3u.
Output format:
Standard track listing, with fields: file, Time, Title, Date, Album, Artist, Track
Pattern:
listplaylists$
musicpd.org, stored playlists section:
listplaylists
Prints a list of the playlist directory.
After each playlist name the server sends its last modification time as attribute Last-Modified in ISO 8601 format. To avoid problems due to clock differences between clients and the server, clients should not compare this value with their local clock.
Output format:
playlist: a
Last-Modified: 2010-02-06T02:10:25Z
playlist: b
Last-Modified: 2010-02-06T02:11:08Z
Clarifications:
Pattern:
load\ "(?P<name>[^"]+)"(\ "(?P<start>\d+):(?P<end>\d+)*")*$
musicpd.org, stored playlists section:
load {NAME} [START:END]
Loads the playlist into the current queue. Playlist plugins are supported. A range may be specified to load only a part of the playlist.
Clarifications:
Pattern:
playlistadd\ "(?P<name>[^"]+)"\ "(?P<uri>[^"]+)"$
musicpd.org, stored playlists section:
playlistadd {NAME} {URI}
Adds URI to the playlist NAME.m3u.
NAME.m3u will be created if it does not exist.
Pattern:
playlistclear\ "(?P<name>[^"]+)"$
musicpd.org, stored playlists section:
playlistclear {NAME}
Clears the playlist NAME.m3u.
Pattern:
playlistdelete\ "(?P<name>[^"]+)"\ "(?P<songpos>\d+)"$
musicpd.org, stored playlists section:
playlistdelete {NAME} {SONGPOS}
Deletes SONGPOS from the playlist NAME.m3u.
Pattern:
playlistmove\ "(?P<name>[^"]+)"\ "(?P<from_pos>\d+)"\ "(?P<to_pos>\d+)"$
musicpd.org, stored playlists section:
playlistmove {NAME} {SONGID} {SONGPOS}
Moves SONGID in the playlist NAME.m3u to the position SONGPOS.
Clarifications:
Pattern:
rename\ "(?P<old_name>[^"]+)"\ "(?P<new_name>[^"]+)"$
musicpd.org, stored playlists section:
rename {NAME} {NEW_NAME}
Renames the playlist NAME.m3u to NEW_NAME.m3u.