Module SkhcDb.MusicFileSource

Operation on music file.

Sourcemodule Column : sig ... end

MusicFile's table columns

Sourcetype t

type of music file.

Sourceval init : audioproperties:Otaglibc.audioproperties option -> album_id:int64 option -> size:int -> flag:bool -> rating:int option -> has_cover:bool -> string -> t

init ~audioproperties ~album_id ~size ~flag ~has_cover name creates a music file at Unix.time () with the id = 0.

Sourceval table_name : string

table name

Sourceval equal : t -> t -> bool

equal m1 m2 tests whether m1 equals m2. All fields are used for the test.

Sourceval compare : t -> t -> int

compare m1 m2 is Stdlib.compare.

Sourceval to_string : t -> string

to_string t is a string representation of t.

Sourceval pp : Format.formatter -> t -> unit

pp format t is a preety printer for t.

Sourceval find_from_id : Database.t -> int64 -> (t option, Sqlite3.Rc.t * string) result

find_from_id db id tries to find the artist inside db with id

  • since 0.3.0
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.

Sourceval all : Database.t -> (t list, Sqlite3.Rc.t * string) result

all db queries all music files inside db.

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

insert ?old database t inserts t into database. if old, insert will use id, play_count, flag, rating and created_at fields of old to insert and returns the value.

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

update db music updates db with music.

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

remove_id db id removes music file inside db with the id id.

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

remove db music is remove_id db (id music).

Sourceval to_yojson : t -> Yojson.Safe.t
Sourceval id : t -> Int64.t
Sourceval path : t -> string
Sourceval album_id : t -> Int64.t option
Sourceval size : t -> int
Sourceval play_count : t -> int
Sourceval flag : t -> bool
Sourceval rating : t -> int option
Sourceval duration : t -> int
Sourceval bitrate : t -> int
Sourceval samplerate : t -> int
Sourceval channels : t -> int
Sourceval has_cover : t -> bool
Sourceval played_at : t -> float option
Sourceval created_at : t -> float
Sourceval updated_at : t -> float
Sourceval audioproperties : t -> Otaglibc.audioproperties
Sourceval set_id : Int64.t -> t -> t
Sourceval set_path : string -> t -> t
Sourceval set_album_id : Int64.t option -> t -> t
Sourceval set_size : int -> t -> t
Sourceval set_play_count : int -> t -> t
Sourceval set_flag : bool -> t -> t
Sourceval set_rating : int option -> t -> t
Sourceval set_duration : int -> t -> t
Sourceval set_bitrate : int -> t -> t
Sourceval set_samplerate : int -> t -> t
Sourceval set_channels : int -> t -> t
Sourceval set_has_cover : bool -> t -> t
Sourceval set_played_at : float option -> t -> t
Sourceval set_created_at : float -> t -> t
Sourceval set_updated_at : float -> t -> t