rocksky/scrobble

app.rocksky.scrobble.* — record listens and read them back.

Types

Builder for a createScrobble payload. The title and artist fields are required by the lexicon; everything else is optional. Build one with new_scrobble(...), layer with_* setters, then call create to produce a Request(Scrobble).

pub type NewScrobble {
  NewScrobble(
    title: String,
    artist: String,
    album: option.Option(String),
    duration_ms: option.Option(Int),
    mb_id: option.Option(String),
    isrc: option.Option(String),
    album_art: option.Option(String),
    track_number: option.Option(Int),
    release_date: option.Option(String),
    year: option.Option(Int),
    disc_number: option.Option(Int),
    lyrics: option.Option(String),
    composer: option.Option(String),
    copyright_message: option.Option(String),
    label: option.Option(String),
    artist_picture: option.Option(String),
    spotify_link: option.Option(String),
    lastfm_link: option.Option(String),
    tidal_link: option.Option(String),
    apple_music_link: option.Option(String),
    youtube_link: option.Option(String),
    deezer_link: option.Option(String),
    timestamp: option.Option(Int),
  )
}

Constructors

Values

pub fn create(s: NewScrobble) -> rocksky.Request(types.Scrobble)

Convert a NewScrobble into a Request(Scrobble) ready for rocksky.send.

scrobble.new_scrobble(title: "Karma Police", artist: "Radiohead")
|> scrobble.with_album("OK Computer")
|> scrobble.with_duration_ms(263_000)
|> scrobble.create
|> rocksky.send(client)
pub fn get_scrobble(
  uri uri: String,
) -> rocksky.Request(types.Scrobble)

app.rocksky.scrobble.getScrobble — fetch a single scrobble by AT-URI.

pub fn get_scrobbles() -> rocksky.Request(dynamic.Dynamic)

app.rocksky.scrobble.getScrobbles — paginated scrobble feed. Refine with rocksky.limit, rocksky.offset, with_did, with_following.

pub fn new_scrobble(
  title title: String,
  artist artist: String,
) -> NewScrobble
pub fn with_album(s: NewScrobble, v: String) -> NewScrobble
pub fn with_album_art(s: NewScrobble, v: String) -> NewScrobble
pub fn with_apple_music_link(
  s: NewScrobble,
  v: String,
) -> NewScrobble
pub fn with_artist_picture(
  s: NewScrobble,
  v: String,
) -> NewScrobble
pub fn with_composer(s: NewScrobble, v: String) -> NewScrobble
pub fn with_copyright_message(
  s: NewScrobble,
  v: String,
) -> NewScrobble
pub fn with_deezer_link(s: NewScrobble, v: String) -> NewScrobble
pub fn with_did(
  req: rocksky.Request(a),
  did: String,
) -> rocksky.Request(a)
pub fn with_disc_number(s: NewScrobble, v: Int) -> NewScrobble
pub fn with_duration_ms(s: NewScrobble, v: Int) -> NewScrobble
pub fn with_following(
  req: rocksky.Request(a),
  following: Bool,
) -> rocksky.Request(a)
pub fn with_isrc(s: NewScrobble, v: String) -> NewScrobble
pub fn with_label(s: NewScrobble, v: String) -> NewScrobble
pub fn with_lastfm_link(s: NewScrobble, v: String) -> NewScrobble
pub fn with_lyrics(s: NewScrobble, v: String) -> NewScrobble
pub fn with_mb_id(s: NewScrobble, v: String) -> NewScrobble
pub fn with_release_date(
  s: NewScrobble,
  v: String,
) -> NewScrobble
pub fn with_spotify_link(
  s: NewScrobble,
  v: String,
) -> NewScrobble
pub fn with_tidal_link(s: NewScrobble, v: String) -> NewScrobble
pub fn with_timestamp(
  s: NewScrobble,
  unix_seconds: Int,
) -> NewScrobble

Set the scrobble timestamp in Unix seconds. Omit to default to now (server-side).

pub fn with_track_number(s: NewScrobble, v: Int) -> NewScrobble
pub fn with_year(s: NewScrobble, v: Int) -> NewScrobble
pub fn with_youtube_link(
  s: NewScrobble,
  v: String,
) -> NewScrobble
Search Document