The playlist manipulation commands can only operate on the currently loaded playlist. If you have navigated to a location in a nested playlist they will fail.
Command | Description | Reply |
---|---|---|
pl clear clear |
Clears the current playlist. | Number of items in the list, -1 if unknown, Empty = error. |
pl add <url> [<url>
[...]] add ... |
Inserts URLs, files or
directories into
the
current playlist. The items are placed before the current item. If the
current item is not set the
new items are appended. The names or URLs can be enclosed with double quotes. The operation is not atomic in case of an error. |
Number of added items or empty on error. |
dir <directory> (1.) rdir <directory>(1.) |
Insert all supported files in <directory> and in case of rdir it's subdirectories into the playlist. The content is placed before the current item or appended, if the current item is not set. | Number of added items or empty on error. |
pl remove remove |
Removes currently selected item from the current playlist. | URL of the removed item or empty line on error. |
pl setitem <key>[=<value>] | Modify a property of a playlist item. See pl info item for valid keys and syntax. | Empty = error. |
pl sort display pl sort song pl sort artist pl sort album pl sort track pl sort year pl sort object pl sort time pl sort size pl sort random |
Sort the content of the current playlist by the given criterion. The sort operation is stable, i.e. when sorting by album name the order of the songs of the same album is preserved. You might use this to sort by multiple properties, e.g. sort by the track first and by the album secondly. This effectively orders by album and then by track. | Empty = error. |
pl save [<file>] save [<file>] |
Save the current playlist as <file>. If <file> is omitted the playlist is saved in place. The latter only works on mutable lists. | Result code, non-zero = error. |
The handling of the
directories has significantly
changed with PM123 1.40. The dir and rdir commands
emulate the old behavior of PM123 by loading the desired directory
structure into memory removing all files that have no decoder
associated with their file type and then insert the remaining files
into the current playlist.
Alternatively you could use add to insert
a reference to the directory instead. This has the side effect that the
directory is rescanned every time
the playlist is loaded into memory.