Refresh covers asynchronously

This commit is contained in:
Claudio Ortolina
2025-04-14 10:58:47 +01:00
parent 995773f673
commit a3b6510c40
4 changed files with 47 additions and 10 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ defmodule MusicLibrary.Worker.RefreshCover do
@impl Oban.Worker
def perform(%Oban.Job{args: %{"id" => record_id}}) do
record = MusicLibrary.Records.get_record!(record_id)
{:ok, _} = MusicLibrary.Records.refresh_cover(record)
{:ok, new_record} = MusicLibrary.Records.refresh_cover(record)
MusicLibrary.Records.notify_update(new_record)
:ok
end
end