Relax ScrobbleRule.t to allow unpersisted structs

This commit is contained in:
Claudio Ortolina
2026-04-21 12:47:38 +01:00
parent 87d2a8f186
commit 53348a328e
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ defmodule MusicLibrary.ScrobbleRules do
def get_scrobble_rule!(id), do: Repo.get!(ScrobbleRule, id)
@spec create_scrobble_rule(map()) :: {:ok, ScrobbleRule.t()} | {:error, Ecto.Changeset.t()}
def create_scrobble_rule(attrs \\ %{}) do
def create_scrobble_rule(attrs) do
%ScrobbleRule{}
|> ScrobbleRule.changeset(attrs)
|> Repo.insert()
@@ -5,9 +5,9 @@ defmodule MusicLibrary.ScrobbleRules.ScrobbleRule do
@type t :: %__MODULE__{
id: integer() | nil,
type: :album | :artist,
match_value: String.t(),
target_musicbrainz_id: String.t(),
type: :album | :artist | nil,
match_value: String.t() | nil,
target_musicbrainz_id: String.t() | nil,
enabled: boolean(),
description: String.t() | nil,
inserted_at: DateTime.t() | nil,