View Source LastfmArchive.Behaviour.LastfmClient behaviour (lastfm_archive v1.2.1)

Behaviour and data struct for retrieving data from Lastfm API.

Summary

Callbacks

Returns the total playcount, registered, i.e. first scrobble time for a user.

Returns the playcount and the latest scrobble date of a user for a given time range.

Returns the scrobbles of a user for a given time range.

Types

@type from() :: integer()
@type lastfm_api() :: LastfmArchive.LastfmClient.LastfmApi.t()
Link to this type

latest_scrobble_time()

View Source
@type latest_scrobble_time() :: integer()
@type limit() :: integer()
@type page() :: integer()
@type playcount() :: integer()
@type registered_time() :: integer()
@type to() :: integer()
@type user() :: binary()

Callbacks

@callback info(user(), lastfm_api()) ::
  {:ok, {playcount(), registered_time()}} | {:error, term()}

Returns the total playcount, registered, i.e. first scrobble time for a user.

Link to this callback

playcount(user, {}, lastfm_api)

View Source
@callback playcount(user(), {from(), to()}, lastfm_api()) ::
  {:ok, {playcount(), latest_scrobble_time()}} | {:error, term()}

Returns the playcount and the latest scrobble date of a user for a given time range.

Link to this callback

scrobbles(user, {}, lastfm_api)

View Source
@callback scrobbles(user(), {page(), limit(), from(), to()}, lastfm_api()) ::
  {:ok, map()} | {:error, term()}

Returns the scrobbles of a user for a given time range.

See Lastfm API documentation for more details.