feat(subsonic): update track play stats on scrobble instead of stream

This commit is contained in:
sentriz
2023-09-28 20:58:59 +01:00
parent 6b322e4a1f
commit e0b1603c00
10 changed files with 178 additions and 165 deletions

22
scrobble/scrobble.go Normal file
View File

@@ -0,0 +1,22 @@
package scrobble
import (
"time"
"go.senan.xyz/gonic/db"
)
type Track struct {
Track string
Artist string
Album string
AlbumArtist string
TrackNumber uint
Duration time.Duration
MusicBrainzID string
}
type Scrobbler interface {
IsUserAuthenticated(user db.User) bool
Scrobble(user db.User, track Track, stamp time.Time, submission bool) error
}