paracusia v0.2.1 Paracusia.MpdClient.Playlists

Functions related to stored playlists.

See also: https://musicpd.org/doc/protocol/playlist_files.html

Summary

Functions

Adds uri to the playlist playlist.m3u

Clears the playlist playlist.m3u

Deletes the song at position pos from the playlist

Returns a list containing all songs in the given playlist

Returns a list of all playlists inside the playlists directory

Returns a map containing all songs from the playlist and their metadata

Loads the playlist into the queue

Loads a given range from the playlist into the queue

Moves the song at position from in the playlist playlist.m3u to the position to

Removes the playlist playlist.m3u from the playlist directory

Renames the playlist playlist.m3u to new_name.m3u

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

Functions

add(playlist, uri)

Adds uri to the playlist playlist.m3u

playlist.m3u will be created if it does not already exist.

clear(playlist)

Clears the playlist playlist.m3u

delete_pos(playlist, pos)
delete_pos(String.t, integer) ::
  :ok |
  Paracusia.MpdTypes.mpd_error

Deletes the song at position pos from the playlist.

list(playlist)

Returns a list containing all songs in the given playlist.

list_all()
list_all :: {:ok, [map]} | Paracusia.MpdTypes.mpd_error

Returns a list of all playlists inside the playlists directory.

list_info(playlist)
list_info(String.t) ::
  {:ok, [map]} |
  Paracusia.MpdTypes.mpd_error

Returns a map containing all songs from the playlist and their metadata.

load(playlist)

Loads the playlist into the queue.

Loads a given range from the playlist into the queue.

move(playlist, from, to)
move(String.t, integer, integer) ::
  :ok |
  Paracusia.MpdTypes.mpd_error

Moves the song at position from in the playlist playlist.m3u to the position to.

remove(playlist)

Removes the playlist playlist.m3u from the playlist directory.

rename(playlist, new_name)

Renames the playlist playlist.m3u to new_name.m3u

save(name)

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