diff --git a/lib/music_library/artists.ex b/lib/music_library/artists.ex index 9bc8d85d..00faa05b 100644 --- a/lib/music_library/artists.ex +++ b/lib/music_library/artists.ex @@ -266,10 +266,10 @@ defmodule MusicLibrary.Artists do end end - @spec refresh_lastfm_data_async(String.t()) :: + @spec refresh_lastfm_data_async(ArtistInfo.t()) :: {:ok, Oban.Job.t()} | {:error, Ecto.Changeset.t()} - def refresh_lastfm_data_async(artist_id) do - enqueue_worker(Worker.FetchArtistLastFmData, %{"id" => artist_id}) + def refresh_lastfm_data_async(artist_info) do + enqueue_worker(Worker.FetchArtistLastFmData, %{"id" => artist_info.id}) end @spec refresh_artist_info_async(String.t()) :: diff --git a/lib/music_library/artists/batch.ex b/lib/music_library/artists/batch.ex index 711ff943..dc47d9e6 100644 --- a/lib/music_library/artists/batch.ex +++ b/lib/music_library/artists/batch.ex @@ -33,7 +33,7 @@ defmodule MusicLibrary.Artists.Batch do @spec refresh_lastfm_data() :: {:ok, [String.t()]} def refresh_lastfm_data do Batch.run_on_all(from(r in ArtistInfo), "artist_info", fn artist_info -> - Artists.refresh_lastfm_data_async(artist_info.id) + Artists.refresh_lastfm_data_async(artist_info) end) end end