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

View File

@@ -7,12 +7,11 @@ import (
"io"
"log"
"net/http"
"time"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/jukebox"
"go.senan.xyz/gonic/lastfm"
"go.senan.xyz/gonic/podcasts"
"go.senan.xyz/gonic/scrobble"
"go.senan.xyz/gonic/server/ctrlbase"
"go.senan.xyz/gonic/server/ctrlsubsonic/artistinfocache"
"go.senan.xyz/gonic/server/ctrlsubsonic/params"
@@ -40,11 +39,6 @@ func PathsOf(paths []MusicPath) []string {
return r
}
type Scrobbler interface {
IsUserAuthenticated(user *db.User) bool
Scrobble(user *db.User, track *db.Track, stamp time.Time, submission bool) error
}
type Controller struct {
*ctrlbase.Controller
MusicPaths []MusicPath
@@ -52,7 +46,7 @@ type Controller struct {
CacheAudioPath string
CacheCoverPath string
Jukebox *jukebox.Jukebox
Scrobblers []Scrobbler
Scrobblers []scrobble.Scrobbler
Podcasts *podcasts.Podcasts
Transcoder transcode.Transcoder
LastFMClient *lastfm.Client