2021-06-22 17:15:51 +02:00
|
|
|
package scrobbler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/navidrome/navidrome/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Scrobble struct {
|
2021-06-22 20:00:44 +02:00
|
|
|
model.MediaFile
|
|
|
|
TimeStamp time.Time
|
2021-06-22 17:15:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Scrobbler interface {
|
2021-06-23 04:27:53 +02:00
|
|
|
IsAuthorized(ctx context.Context, userId string) bool
|
2021-06-22 20:00:44 +02:00
|
|
|
NowPlaying(ctx context.Context, userId string, track *model.MediaFile) error
|
|
|
|
Scrobble(ctx context.Context, userId string, scrobbles []Scrobble) error
|
2021-06-22 17:15:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Constructor func(ds model.DataStore) Scrobbler
|