mpc-js
    Preparing search index...

    Interface StoredPlaylistsCommands

    interface StoredPlaylistsCommands {
        listPlaylist(name: string): Promise<string[]>;
        listPlaylistInfo(name: string): Promise<PlaylistItem[]>;
        listPlaylists(): Promise<StoredPlaylist[]>;
        load(
            name: string,
            start?: number,
            end?: number,
            position?: number,
        ): Promise<void>;
        playlistAdd(name: string, uri: string, position?: number): Promise<void>;
        playlistClear(name: string): Promise<void>;
        playlistDelete(name: string, position: number): Promise<void>;
        playlistLength(name: string): Promise<SongCount>;
        playlistMove(name: string, from: number, to: number): Promise<void>;
        remove(name: string): Promise<void>;
        rename(name: string, newName: string): Promise<void>;
        save(name: string): Promise<void>;
        searchPlaylist(
            name: string,
            filter: string | [string, string][],
        ): Promise<PlaylistItem[]>;
    }

    Hierarchy

    • ReturnType<typeof createStoredPlaylistsCommands>
      • StoredPlaylistsCommands
    Index

    Methods

    • Lists the songs in the playlist. Playlist plugins are supported.

      Parameters

      • name: string

      Returns Promise<string[]>

    • Prints a list of the playlist directory. Each playlist name comes with its last modification time. To avoid problems due to clock differences between clients and the server, clients should not compare this value with their local clock.

      Returns Promise<StoredPlaylist[]>

    • Loads the playlist into the current queue. Playlist plugins are supported. A range may be specified to load only a part of the playlist. The position parameter specifies where the songs will be inserted into the queue.

      Parameters

      • name: string
      • Optionalstart: number
      • Optionalend: number
      • Optionalposition: number

      Returns Promise<void>

    • Adds uri to the playlist name.m3u. name.m3u will be created if it does not exist. The position parameter specifies where the songs will be inserted into the playlist.

      Parameters

      • name: string
      • uri: string
      • Optionalposition: number

      Returns Promise<void>

    • Clears the playlist name.m3u.

      Parameters

      • name: string

      Returns Promise<void>

    • Deletes position from the playlist name.m3u.

      Parameters

      • name: string
      • position: number

      Returns Promise<void>

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

      Parameters

      • name: string
      • from: number
      • to: number

      Returns Promise<void>

    • Removes the playlist name.m3u from the playlist directory.

      Parameters

      • name: string

      Returns Promise<void>

    • Renames the playlist name.m3u to newName.m3u.

      Parameters

      • name: string
      • newName: string

      Returns Promise<void>

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

      Parameters

      • name: string

      Returns Promise<void>

    • Search the playlist for songs matching the given filter. Playlist plugins are supported.

      Parameters

      • name: string
      • filter: string | [string, string][]

      Returns Promise<PlaylistItem[]>