First pass at uniformed types, specs and docs

- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
This commit is contained in:
Claudio Ortolina
2026-03-06 08:33:11 +00:00
parent 99e30d5fdf
commit 7cf9b4e7f8
81 changed files with 652 additions and 300 deletions
@@ -4,6 +4,15 @@ defmodule MusicBrainz.ReleaseGroupSearchResult do
@enforce_keys [:id, :type, :title, :artists, :release_date]
defstruct [:id, :type, :title, :artists, :release_date]
@type t :: %__MODULE__{
id: String.t(),
type: :album | :ep | :live | :compilation | :single | :other,
title: String.t(),
artists: String.t(),
release_date: String.t() | nil
}
@spec from_api_response(map()) :: t()
def from_api_response(rg) do
%__MODULE__{
id: rg["id"],
@@ -14,6 +23,7 @@ defmodule MusicBrainz.ReleaseGroupSearchResult do
}
end
@spec thumb_url(t()) :: String.t()
def thumb_url(rgr) do
"https://coverartarchive.org/release-group/#{rgr.id}/front-250"
end