Render recently scrobbled tracks in stats

This commit is contained in:
Claudio Ortolina
2024-11-04 12:04:13 +00:00
parent d818cdbae5
commit 7139e0ad8f
5 changed files with 49 additions and 12 deletions
+6 -6
View File
@@ -6,15 +6,11 @@ defmodule LastFm.Supervisor do
end
@impl true
def init(opts) do
def init(_opts) do
:ok = LastFm.Feed.create_table!()
api =
Keyword.fetch!(opts, :api)
|> IO.inspect()
children = [
{LastFm.Refresh, %{api: api, user: "cloud8421", api_key: api_key()}}
{LastFm.Refresh, %{api: api(), user: "cloud8421", api_key: api_key()}}
]
Supervisor.init(children, strategy: :one_for_one)
@@ -24,4 +20,8 @@ defmodule LastFm.Supervisor do
Application.get_env(:music_library, LastFm, [])
|> Keyword.get(:api_key)
end
defp api do
Application.get_env(:music_library, :last_fm, LastFm.APIImpl)
end
end