mopidy.mpd — MPD server

For details on how to use Mopidy’s MPD server, see Mopidy-MPD.

MPD tokenizer

mopidy.mpd.tokenize.split(line)[source]

Splits a line into tokens using same rules as MPD.

  • Lines may not start with whitespace
  • Tokens are split by arbitrary amount of spaces or tabs
  • First token must match [a-z][a-z0-9_]*
  • Remaining tokens can be unquoted or quoted tokens.
  • Unquoted tokens consist of all printable characters except double quotes, single quotes, spaces and tabs.
  • Quoted tokens are surrounded by a matching pair of double quotes.
  • The closing quote must be followed by space, tab or end of line.
  • Any value is allowed inside a quoted token. Including double quotes, assuming it is correctly escaped.
  • Backslash inside a quoted token is used to escape the following character.

For examples see the tests for this function.

MPD dispatcher

MPD protocol

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.

mopidy.mpd.protocol.BOOL(value)[source]

Convert the values 0 and 1 into booleans.

class mopidy.mpd.protocol.Commands[source]

Collection of MPD commands to expose to users.

Normally used through the global instance which command handlers have been installed into.

add(name, auth_required=True, list_command=True, **validators)[source]

Create a decorator that registers a handler and validation rules.

Additional keyword arguments are treated as converters/validators to apply to tokens converting them to proper Python types.

Requirements for valid handlers:

  • must accept a context argument as the first arg.
  • may not use variable keyword arguments, **kwargs.
  • may use variable arguments *args or a mix of required and optional arguments.

Decorator returns the unwrapped function so that tests etc can use the functions with values with correct python types instead of strings.

Parameters:
  • name (string) – Name of the command being registered.
  • auth_required (bool) – If authorization is required.
  • list_command (bool) – If command should be listed in reflection.
call(tokens, context=None)[source]

Find and run the handler registered for the given command.

If the handler was registered with any converters/validators they will be run before calling the real handler.

Parameters:
  • tokens (list) – List of tokens to process
  • context (MpdContext) – MPD context.
mopidy.mpd.protocol.ENCODING = u'UTF-8'

The MPD protocol uses UTF-8 for encoding all data.

mopidy.mpd.protocol.INT(value)[source]

Converts a value that matches [+-]?d+ into and integer.

mopidy.mpd.protocol.LINE_TERMINATOR = u'\n'

The MPD protocol uses \n as line terminator.

mopidy.mpd.protocol.RANGE(value)[source]

Convert a single integer or range spec into a slice

n should become slice(n, n+1) n: should become slice(n, None) n:m should become slice(n, m) and m > n must hold

mopidy.mpd.protocol.UINT(value)[source]

Converts a value that matches d+ into an integer.

mopidy.mpd.protocol.VERSION = u'0.19.0'

The MPD protocol version is 0.19.0.

mopidy.mpd.protocol.commands = <mopidy.mpd.protocol.Commands object>

Global instance to install commands into

mopidy.mpd.protocol.load_protocol_modules()[source]

The protocol modules must be imported to get them registered in commands.

Audio output

mopidy.mpd.protocol.audio_output.disableoutput(context, outputid)[source]

musicpd.org, audio output section:

disableoutput {ID}

Turns an output off.

mopidy.mpd.protocol.audio_output.enableoutput(context, outputid)[source]

musicpd.org, audio output section:

enableoutput {ID}

Turns an output on.

mopidy.mpd.protocol.audio_output.outputs(context)[source]

musicpd.org, audio output section:

outputs

Shows information about all outputs.

mopidy.mpd.protocol.audio_output.toggleoutput(context, outputid)[source]

musicpd.org, audio output section:

toggleoutput {ID}

Turns an output on or off, depending on the current state.

Channels

mopidy.mpd.protocol.channels.channels(context)[source]

musicpd.org, client to client section:

channels

Obtain a list of all channels. The response is a list of “channel:” lines.

mopidy.mpd.protocol.channels.readmessages(context)[source]

musicpd.org, client to client section:

readmessages

Reads messages for this client. The response is a list of “channel:” and “message:” lines.

mopidy.mpd.protocol.channels.sendmessage(context, channel, text)[source]

musicpd.org, client to client section:

sendmessage {CHANNEL} {TEXT}

Send a message to the specified channel.

mopidy.mpd.protocol.channels.subscribe(context, channel)[source]

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.

mopidy.mpd.protocol.channels.unsubscribe(context, channel)[source]

musicpd.org, client to client section:

unsubscribe {NAME}

Unsubscribe from a channel.

Command list

mopidy.mpd.protocol.command_list.command_list_begin(context)[source]

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.

mopidy.mpd.protocol.command_list.command_list_end(context)[source]

See command_list_begin().

mopidy.mpd.protocol.command_list.command_list_ok_begin(context)[source]

See command_list_begin().

Connection

mopidy.mpd.protocol.connection.close(context)[source]

musicpd.org, connection section:

close

Closes the connection to MPD.

mopidy.mpd.protocol.connection.kill(context)[source]

musicpd.org, connection section:

kill

Kills MPD.

mopidy.mpd.protocol.connection.password(context, password)[source]

musicpd.org, connection section:

password {PASSWORD}

This is used for authentication with the server. PASSWORD is simply the plaintext password.

mopidy.mpd.protocol.connection.ping(context)[source]

musicpd.org, connection section:

ping

Does nothing but return OK.

Current playlist

mopidy.mpd.protocol.current_playlist.add(context, uri)[source]

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:

  • add "" should add all tracks in the library to the current playlist.
mopidy.mpd.protocol.current_playlist.addid(context, uri, songpos=None)[source]

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:

  • addid "" should return an error.
mopidy.mpd.protocol.current_playlist.addtagid(context, tlid, tag, value)[source]

musicpd.org, current playlist section:

addtagid {SONGID} {TAG} {VALUE}

Adds a tag to the specified song. Editing song tags is only possible for remote songs. This change is volatile: it may be overwritten by tags received from the server, and the data is gone when the song gets removed from the queue.

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.current_playlist.clear(context)[source]

musicpd.org, current playlist section:

clear

Clears the current playlist.

mopidy.mpd.protocol.current_playlist.cleartagid(context, tlid, tag)[source]

musicpd.org, current playlist section:

cleartagid {SONGID} [TAG]

Removes tags from the specified song. If TAG is not specified, then all tag values will be removed. Editing song tags is only possible for remote songs.

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.current_playlist.delete(context, songrange)[source]

musicpd.org, current playlist section:

delete [{POS} | {START:END}]

Deletes a song from the playlist.

mopidy.mpd.protocol.current_playlist.deleteid(context, tlid)[source]

musicpd.org, current playlist section:

deleteid {SONGID}

Deletes the song SONGID from the playlist

mopidy.mpd.protocol.current_playlist.move_range(context, songrange, to)[source]

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.

mopidy.mpd.protocol.current_playlist.moveid(context, tlid, to)[source]

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).

mopidy.mpd.protocol.current_playlist.playlist(context)[source]

musicpd.org, current playlist section:

playlist

Displays the current playlist.

Note

Do not use this, instead use playlistinfo.

mopidy.mpd.protocol.current_playlist.playlistfind(context, tag, needle)[source]

musicpd.org, current playlist section:

playlistfind {TAG} {NEEDLE}

Finds songs in the current playlist with strict matching.

mopidy.mpd.protocol.current_playlist.playlistid(context, tlid=None)[source]

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.

mopidy.mpd.protocol.current_playlist.playlistinfo(context, parameter=None)[source]

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:

  • uses negative indexes, like playlistinfo "-1", to request the entire playlist
mopidy.mpd.protocol.current_playlist.playlistsearch(context, tag, needle)[source]

musicpd.org, current playlist section:

playlistsearch {TAG} {NEEDLE}

Searches case-sensitively for partial matches in the current playlist.

GMPC:

  • uses filename and any as tags
mopidy.mpd.protocol.current_playlist.plchanges(context, version)[source]

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:

  • Calls plchanges "-1" two times per second to get the entire playlist.
mopidy.mpd.protocol.current_playlist.plchangesposid(context, version)[source]

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.

mopidy.mpd.protocol.current_playlist.prio(context, priority, position)[source]

musicpd.org, current playlist section:

prio {PRIORITY} {START:END...}

Set the priority of the specified songs. A higher priority means that it will be played first when “random” mode is enabled.

A priority is an integer between 0 and 255. The default priority of new songs is 0.

mopidy.mpd.protocol.current_playlist.prioid(context, *args)[source]

musicpd.org, current playlist section:

prioid {PRIORITY} {ID...}

Same as prio, but address the songs with their id.

mopidy.mpd.protocol.current_playlist.rangeid(context, tlid, songrange)[source]

musicpd.org, current playlist section:

rangeid {ID} {START:END}

Specifies the portion of the song that shall be played. START and END are offsets in seconds (fractional seconds allowed); both are optional. Omitting both (i.e. sending just “:”) means “remove the range, play everything”. A song that is currently playing cannot be manipulated this way.

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.current_playlist.shuffle(context, songrange=None)[source]

musicpd.org, current playlist section:

shuffle [START:END]

Shuffles the current playlist. START:END is optional and specifies a range of songs.

mopidy.mpd.protocol.current_playlist.swap(context, songpos1, songpos2)[source]

musicpd.org, current playlist section:

swap {SONG1} {SONG2}

Swaps the positions of SONG1 and SONG2.

mopidy.mpd.protocol.current_playlist.swapid(context, tlid1, tlid2)[source]

musicpd.org, current playlist section:

swapid {SONG1} {SONG2}

Swaps the positions of SONG1 and SONG2 (both song ids).

Mounts and neighbors

mopidy.mpd.protocol.mount.listmounts(context)[source]

musicpd.org, mounts and neighbors section:

listmounts

Queries a list of all mounts. By default, this contains just the configured music_directory. Example:

listmounts
mount:
storage: /home/foo/music
mount: foo
storage: nfs://192.168.1.4/export/mp3
OK

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.mount.listneighbors(context)[source]

musicpd.org, mounts and neighbors section:

listneighbors

Queries a list of “neighbors” (e.g. accessible file servers on the local net). Items on that list may be used with the mount command. Example:

listneighbors
neighbor: smb://FOO
name: FOO (Samba 4.1.11-Debian)
OK

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.mount.mount(context, path, uri)[source]

musicpd.org, mounts and neighbors section:

mount {PATH} {URI}

Mount the specified remote storage URI at the given path. Example:

mount foo nfs://192.168.1.4/export/mp3

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.mount.unmount(context, path)[source]

musicpd.org, mounts and neighbors section:

unmount {PATH}

Unmounts the specified path. Example:

unmount foo

New in version 0.19: New in MPD protocol version 0.19

Music database

mopidy.mpd.protocol.music_db.count(context, *args)[source]

musicpd.org, music database section:

count {TAG} {NEEDLE}

Counts the number of songs and their total playtime in the db matching TAG exactly.

GMPC:

  • use multiple tag-needle pairs to make more specific searches.
mopidy.mpd.protocol.music_db.find(context, *args)[source]

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:

  • also uses find album "[ALBUM]" artist "[ARTIST]" to list album tracks.

ncmpc:

  • capitalizes the type argument.

ncmpcpp:

  • also uses the search type “date”.
  • uses “file” instead of “filename”.
mopidy.mpd.protocol.music_db.findadd(context, *args)[source]

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.

mopidy.mpd.protocol.music_db.list_(context, *args)[source]

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

ncmpc:

  • capitalizes the field argument.
mopidy.mpd.protocol.music_db.listall(context, uri=None)[source]

musicpd.org, music database section:

listall [URI]

Lists all songs and directories in URI.

Do not use this command. Do not manage a client-side copy of MPD’s database. That is fragile and adds huge overhead. It will break with large databases. Instead, query MPD whenever you need something.

Warning

This command is disabled by default in Mopidy installs.

mopidy.mpd.protocol.music_db.listallinfo(context, uri=None)[source]

musicpd.org, music database section:

listallinfo [URI]

Same as listall, except it also returns metadata info in the same format as lsinfo.

Do not use this command. Do not manage a client-side copy of MPD’s database. That is fragile and adds huge overhead. It will break with large databases. Instead, query MPD whenever you need something.

Warning

This command is disabled by default in Mopidy installs.

mopidy.mpd.protocol.music_db.listfiles(context, uri=None)[source]

musicpd.org, music database section:

listfiles [URI]

Lists the contents of the directory URI, including files are not recognized by MPD. URI can be a path relative to the music directory or an URI understood by one of the storage plugins. The response contains at least one line for each directory entry with the prefix “file: ” or “directory: “, and may be followed by file attributes such as “Last-Modified” and “size”.

For example, “smb://SERVER” returns a list of all shares on the given SMB/CIFS server; “nfs://servername/path” obtains a directory listing from the NFS server.

New in version 0.19: New in MPD protocol version 0.19

mopidy.mpd.protocol.music_db.lsinfo(context, uri=None)[source]

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 "/".

mopidy.mpd.protocol.music_db.readcomments(context, uri)[source]

musicpd.org, music database section:

readcomments [URI]

Read “comments” (i.e. key-value pairs) from the file specified by “URI”. This “URI” can be a path relative to the music directory or a URL in the form “file:///foo/bar.ogg”.

This command may be used to list metadata of remote files (e.g. URI beginning with “http://” or “smb://”).

The response consists of lines in the form “KEY: VALUE”. Comments with suspicious characters (e.g. newlines) are ignored silently.

The meaning of these depends on the codec, and not all decoder plugins support it. For example, on Ogg files, this lists the Vorbis comments.

mopidy.mpd.protocol.music_db.rescan(context, uri=None)[source]

musicpd.org, music database section:

rescan [URI]

Same as update, but also rescans unmodified files.

mopidy.mpd.protocol.music_db.search(context, *args)[source]

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:

  • uses the undocumented field any.

  • searches for multiple words like this:

    search any "foo" any "bar" any "baz"
    

ncmpc:

  • capitalizes the field argument.

ncmpcpp:

  • also uses the search type “date”.
  • uses “file” instead of “filename”.
mopidy.mpd.protocol.music_db.searchadd(context, *args)[source]

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.

mopidy.mpd.protocol.music_db.searchaddpl(context, *args)[source]

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.

mopidy.mpd.protocol.music_db.update(context, uri=None)[source]

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.

Playback

Reflection

mopidy.mpd.protocol.reflection.commands(context)[source]

musicpd.org, reflection section:

commands

Shows which commands the current user has access to.

mopidy.mpd.protocol.reflection.config(context)[source]

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).

mopidy.mpd.protocol.reflection.decoders(context)[source]

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:

  • ncmpcpp asks for decoders the first time you open the browse view. By returning nothing and OK instead of an not implemented error, we avoid “Not implemented” showing up in the ncmpcpp interface, and we get the list of playlists without having to enter the browse interface twice.
mopidy.mpd.protocol.reflection.notcommands(context)[source]

musicpd.org, reflection section:

notcommands

Shows which commands the current user does not have access to.

mopidy.mpd.protocol.reflection.tagtypes(context)[source]

musicpd.org, reflection section:

tagtypes

Shows a list of available song metadata.

mopidy.mpd.protocol.reflection.urlhandlers(context)[source]

musicpd.org, reflection section:

urlhandlers

Gets a list of available URL handlers.

Status

Stickers

mopidy.mpd.protocol.stickers.sticker(context, action, field, uri, name=None, value=None)[source]

musicpd.org, sticker section:

sticker list {TYPE} {URI}

Lists the stickers for the specified object.

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.

sticker get {TYPE} {URI} {NAME}

Reads a sticker value for the specified object.

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.

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.

Stored playlists

mopidy.mpd.protocol.stored_playlists.listplaylist(context, name)[source]

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
mopidy.mpd.protocol.stored_playlists.listplaylistinfo(context, name)[source]

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
mopidy.mpd.protocol.stored_playlists.listplaylists(context)[source]

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:

  • ncmpcpp 0.5.10 segfaults if we return ‘playlist: ‘ on a line, so we must ignore playlists without names, which isn’t very useful anyway.
mopidy.mpd.protocol.stored_playlists.load(context, name, playlist_slice=slice(0, None, None))[source]

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:

  • load appends the given playlist to the current playlist.
  • MPD 0.17.1 does not support open-ended ranges, i.e. without end specified, for the load command, even though MPD’s general range docs allows open-ended ranges.
  • MPD 0.17.1 does not fail if the specified range is outside the playlist, in either or both ends.
mopidy.mpd.protocol.stored_playlists.playlistadd(context, name, track_uri)[source]

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.

mopidy.mpd.protocol.stored_playlists.playlistclear(context, name)[source]

musicpd.org, stored playlists section:

playlistclear {NAME}

Clears the playlist NAME.m3u.

The playlist will be created if it does not exist.

mopidy.mpd.protocol.stored_playlists.playlistdelete(context, name, songpos)[source]

musicpd.org, stored playlists section:

playlistdelete {NAME} {SONGPOS}

Deletes SONGPOS from the playlist NAME.m3u.

mopidy.mpd.protocol.stored_playlists.playlistmove(context, name, from_pos, to_pos)[source]

musicpd.org, stored playlists section:

playlistmove {NAME} {SONGID} {SONGPOS}

Moves SONGID in the playlist NAME.m3u to the position SONGPOS.

Clarifications:

  • The second argument is not a SONGID as used elsewhere in the protocol documentation, but just the SONGPOS to move from, i.e. playlistmove {NAME} {FROM_SONGPOS} {TO_SONGPOS}.
mopidy.mpd.protocol.stored_playlists.rename(context, old_name, new_name)[source]

musicpd.org, stored playlists section:

rename {NAME} {NEW_NAME}

Renames the playlist NAME.m3u to NEW_NAME.m3u.

mopidy.mpd.protocol.stored_playlists.rm(context, name)[source]

musicpd.org, stored playlists section:

rm {NAME}

Removes the playlist NAME.m3u from the playlist directory.

mopidy.mpd.protocol.stored_playlists.save(context, name)[source]

musicpd.org, stored playlists section:

save {NAME}

Saves the current playlist to NAME.m3u in the playlist directory.