feat(subsonic): update play stats when scrobbling

closes: #207

Co-authored-by: Brian Doherty <brian.r.doherty@gmail.com>
This commit is contained in:
sentriz
2022-03-22 19:36:33 +00:00
parent 59c404749f
commit 1ab47d6fbe
2 changed files with 53 additions and 18 deletions

View File

@@ -55,6 +55,10 @@ func (c *Controller) ServeScrobble(r *http.Request) *spec.Response {
optStamp := params.GetOrTime("time", time.Now())
optSubmission := params.GetOrBool("submission", true)
if err := streamUpdateStats(c.DB, user.ID, track.Album.ID, optStamp); err != nil {
return spec.NewError(0, "error updating stats: %v", err)
}
var scrobbleErrs multierr.Err
for _, scrobbler := range c.Scrobblers {
if err := scrobbler.Scrobble(user, track, optStamp, optSubmission); err != nil {