Module Album.StatsSource

Operations on album's stats

Sourcetype t

type of album's stats

Sourceval init : music_count:int -> duration:int -> play_count:int -> size:int64 -> avg_rating:float -> played_at:float option -> t

init ~music_count ~duration ~play_count ~size ~avg_rating ~played_at creates a new album stats.

  • before 0.3.3,

    no played_at parameter

Sourceval to_yojson : t -> Yojson.Safe.t
Sourceval music_count : t -> int

music_count stats returns the number of songs.

Sourceval duration : t -> int

duration stats returns the total duration.

Sourceval play_count : t -> int

play_count stats returns the sum of play count.

Sourceval size : t -> int64

size stats returns the total size.

Sourceval avg_duration : t -> float

avg_duration stats returns the average duration.

Sourceval avg_rating : t -> float

avg_rating stats returns the average rating.

Sourceval avg_size : t -> float

avg_size stats returns the average size.

Sourceval played_at : t -> float option

played_at stats returns the most time a track of the album was played.

  • since 0.3.3