Refactor Agents to be singleton

Initial work for Last.fm scrobbler
This commit is contained in:
Deluan
2021-06-22 11:15:51 -04:00
committed by Deluan Quintão
parent f9fa9667a3
commit d5461d0ae9
17 changed files with 289 additions and 212 deletions
+20
View File
@@ -0,0 +1,20 @@
package scrobbler
import (
"context"
"time"
"github.com/navidrome/navidrome/model"
)
type Scrobble struct {
Track *model.MediaFile
TimeStamp *time.Time
}
type Scrobbler interface {
NowPlaying(context.Context, *model.MediaFile) error
Scrobble(context.Context, []Scrobble) error
}
type Constructor func(ds model.DataStore) Scrobbler