package shakuhachi

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module SkhcDb.AlbumParticipantSource

Operations on album's participant

Sourcemodule Column : sig ... end

AlbumParticipant's table columns

Sourcetype t

type of album' participants

Sourceval init : album_id:int64 -> artist_id:int64 -> Role.t -> t

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.

Sourceval equal : t -> t -> bool

equal a1 a2 tests whether a1 equals a2. All fields are used for the test.

Sourceval compare : t -> t -> int

compare a1 a2 is Stdlib.compare.

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

insert db participant inserts participant inside db.

Sourceval filter_map : Database.t -> (t -> 'a option) -> ('a list, Sqlite3.Rc.t * string) result

filter_map db f queries all music files inside db and applies f to every element, keeping all Some elements returned by f.

  • since 0.3.2
Sourceval filter_map_with_album_id : Database.t -> int64 -> (t -> 'a option) -> ('a list, Sqlite3.Rc.t * string) result

filter_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.

  • since 0.3.2
Sourceval remove : Database.t -> t -> (unit, Sqlite3.Rc.t * string) result

remove db participant remove participant from db.

  • since 0.3.2
Sourceval update_artist : Database.t -> int64 -> int64 -> (unit, Sqlite3.Rc.t * string) result

update_artist db old_id new_id replaces old_id by new_id.

Sourceval find : compilation:bool -> Database.t -> (Artist.t * Role.t) list -> Album.t -> Album.t list

find ~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

  • since 0.3.0
Sourceval find_from_metadata : compilation:bool -> Database.t -> SkhcMetadata.Metadata.t -> Album.t list

find_from_metadata ~compilation database metadata is find but use metadata instead of database objects.

  • since 0.3.0
Sourceval find_or_insert : ?insert_on_found:bool -> compilation:bool -> Database.t -> (Artist.t * Role.t) list -> Album.t -> (Album.t, Sqlite3.Rc.t * string) result

find_or_insert ~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.

  • before 0.3.2,

    no insert_on_found optional argument and the behavior of find_or_insert was equivalent to insert_on_found = false.

Sourceval album_id : t -> int64

album_id s returns the music_id in s.

  • since 0.3.2
Sourceval artist_id : t -> int64

artist_id s returns the artist_id in s.

  • since 0.3.2
Sourceval role : t -> Role.t

role s returns the role in s.

  • since 0.3.2