Move refresh config and callers to ListeningStats

This commit is contained in:
Claudio Ortolina
2026-03-27 23:14:09 +00:00
parent fa5e13f303
commit 61dd3f45c7
12 changed files with 23 additions and 40 deletions
-14
View File
@@ -3,8 +3,6 @@ defmodule LastFm.Config do
api_key: String.t(),
shared_secret: String.t(),
user: String.t(),
auto_refresh: boolean(),
refresh_interval: pos_integer(),
user_agent: String.t(),
req_options: Keyword.t(),
api_cooldown: non_neg_integer()
@@ -14,8 +12,6 @@ defmodule LastFm.Config do
defstruct api_key: "",
shared_secret: "",
user: "",
auto_refresh: true,
refresh_interval: 60_000,
user_agent: "change me",
req_options: [],
api_cooldown: 500
@@ -33,16 +29,6 @@ defmodule LastFm.Config do
type: :string,
required: true
],
auto_refresh: [
type: :boolean,
required: false,
default: true
],
refresh_interval: [
type: :pos_integer,
required: false,
default: 60_000
],
user_agent: [
type: :string,
required: false,
+1 -1
View File
@@ -4,7 +4,7 @@ defmodule LastFm.Import do
@spec batch(keyword()) :: {:ok, non_neg_integer()} | {:error, term()}
def batch(opts) do
with {:ok, tracks} <- LastFm.get_tracks(opts) do
LastFm.Feed.update(tracks)
MusicLibrary.ListeningStats.update(tracks)
end
end
end