package shakuhachi
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8bd4675792ec93d705e68d4e43dc04aa1124fcaf644ae3a1a3fda68464276f95
sha512=712efcbe13e6e9d3336f72c2c25d4b41225cdd245f21adeeadc8aa4ad31ca9c905077e0873a3d1165d7c09357c009c859c4a7cd9c2d0c9bffc27144525594e72
doc/shakuhachi.database/SkhcDb/AlbumParticipant/index.html
Module SkhcDb.AlbumParticipantSource
Operations on album's participant
type of album' participants
init ~album_id ~artist_id role creates a new relation by associated a music with album_id an artist with artist_id with a role.
equal a1 a2 tests whether a1 equals a2. All fields are used for the test.
insert db participant inserts participant inside db.
filter_map db f queries all album_participants inside db and applies f to every element, keeping all Some elements returned by f.
val filter_map_with_album_id :
Database.t ->
int64 ->
(t -> 'a option) ->
('a list, Sqlite3.Rc.t * string) resultfilter_map_with_album_id db album_id f is SkhcDb.AlbumParticipant.filter_map with the only element given to f are the one with album_id.
remove db participant remove participant from db.
update_artist db old_id new_id replaces old_id by new_id.
val find :
compilation:bool ->
Database.t ->
(Artist.t * Role.t) list ->
Album.t ->
Album.t listfind ~compilation database artists album tries to find an album in database with the name album.name and at least an arist with the name is in artists unless compilation, in this case only the album.name is check to discriminate albums
val find_from_metadata :
compilation:bool ->
Database.t ->
SkhcMetadata.Metadata.t ->
Album.t listfind_from_metadata ~compilation database metadata is find but use metadata instead of database objects.
val find_or_insert :
?insert_on_found:bool ->
?roles:Role.t list ->
compilation:bool ->
Database.t ->
(Artist.t * Role.t) list ->
Album.t ->
(Album.t, Sqlite3.Rc.t * string) resultfind_or_insert ?insert_on_found ?roles ~compilation database artists album tries to find an album in database with the name album.name and at least an artist with the name is in artists unless compilation, in this case only the album.name is check to discriminate albums. If no album is found, find_or_insert will try to insert album to database.
If insert_on_found, find_or_insert will try to add artists to the already existing album.
If roles, artists is filtered to only use artist having a role within roles. The unmodified artists list is used afterward.