Discogs.Services.JSONFetch (discogs_shuffle v0.2.1) View Source

Fetches release data from the Discogs API.

Link to this section Summary

Types

Discogs JSON API release payload properties

Functions

Fetches a User's release data from the Discogs API.

Link to this section Types

Specs

http_error() :: {:error, status_code :: pos_integer(), body :: binary()}

Specs

release_json() :: %{optional(any()) => any()}

Discogs JSON API release payload properties

Specs

result() :: success() | http_error()

Specs

success() :: {:ok, [release_json()]}

Link to this section Functions

Specs

fetch_releases(
  user :: %Discogs.Models.User{
    __meta__: term(),
    id: term(),
    inserted_at: term(),
    name: term(),
    records: term(),
    releases: term(),
    updated_at: term()
  }
) :: result()

Fetches a User's release data from the Discogs API.

If the responses are paginated, continually fetches to the last page, returning the stitched-up payload.

This does not take rate limiting into account and will probably fail if used to fetch from a user with many thousands of releases.