Don't send scrobbles/nowPlaying updates to Last.fm if user has not authorized

This commit is contained in:
Deluan
2021-06-22 22:27:53 -04:00
committed by Deluan Quintão
parent 8af7dab23d
commit 76acd7da89
4 changed files with 45 additions and 8 deletions
+5
View File
@@ -203,6 +203,11 @@ func (l *lastfmAgent) Scrobble(ctx context.Context, userId string, scrobbles []s
return nil
}
func (l *lastfmAgent) IsAuthorized(ctx context.Context, userId string) bool {
sk, err := l.sessionKeys.get(ctx, userId)
return err == nil && sk != ""
}
func init() {
conf.AddHook(func() {
if conf.Server.LastFM.Enabled {