refactor(server): simplify lastfm agent initialization logic

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-04-19 23:36:53 -04:00
parent 4944f8035a
commit 6f52c0201c
2 changed files with 3 additions and 11 deletions
+2 -10
View File
@@ -344,18 +344,10 @@ func (l *lastfmAgent) IsAuthorized(ctx context.Context, userId string) bool {
func init() {
conf.AddHook(func() {
agents.Register(lastFMAgentName, func(ds model.DataStore) agents.Interface {
a := lastFMConstructor(ds)
if a != nil {
return a
}
return nil
return lastFMConstructor(ds)
})
scrobbler.Register(lastFMAgentName, func(ds model.DataStore) scrobbler.Scrobbler {
a := lastFMConstructor(ds)
if a != nil {
return a
}
return nil
return lastFMConstructor(ds)
})
})
}