Module Collection.PlaylistSource

Operations on playlists

create collection database ~smart ~flag ~rating name query creates a new playlist with songs matched by query. The newly created playlist is inserted inside database and the playlist is returned.

playlists collection database returs all playlists managed by collection.

Sourceval find_from_name : t -> SkhcDb.Database.t -> string -> (SkhcDb.Playlist.t option, Sqlite3.Rc.t * string) result

find_from_name collection database name finds the first playlist having the name name. Returns None if no such playlist is found.

musics collection database playlist fetches all the musics within playlist.

add collection db playlist query adds musics matched by query in playlist. Returns the updated playlist along with its songs.

delete collection db playlist query removes musics matched by query from playlist. Returns the updated playlist along with its songs.

replace collection db playlist query replaces playlist's query by query. For non-smart playlist, This functions also recomputes playlist's songs. Returns the updated playlist along with its songs.

Sourceval remove : t -> SkhcDb.Database.t -> SkhcDb.Playlist.t -> (unit, Sqlite3.Rc.t * string) result

remove collection db playlist removes playlist from db.

Sourceval remove_from_name : t -> SkhcDb.Database.t -> string -> (unit, [> `NoMatchingPlaylist | `SqliteError of Sqlite3.Rc.t * string ]) result

remove_from_name is remove but tries to find the playlist from its name.