From 6ab0488620a930d7ac9ed20349500f5e3391678e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alban=20F=C3=A9ron?= Date: Sat, 31 Dec 2022 18:24:29 +0100 Subject: [PATCH] Add missing save calls in Last.fm handling --- supysonic/lastfm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supysonic/lastfm.py b/supysonic/lastfm.py index d347a7e..3a40645 100644 --- a/supysonic/lastfm.py +++ b/supysonic/lastfm.py @@ -1,7 +1,7 @@ # This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # -# Copyright (C) 2013-2018 Alban 'spl0k' Féron +# Copyright (C) 2013-2022 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. @@ -34,11 +34,13 @@ class LastFm: else: self.__user.lastfm_session = res["session"]["key"] self.__user.lastfm_status = True + self.__user.save() return True, "OK" def unlink_account(self): self.__user.lastfm_session = None self.__user.lastfm_status = True + self.__user.save() def now_playing(self, track): if not self.__enabled: @@ -107,6 +109,7 @@ class LastFm: if "error" in json: if json["error"] in (9, "9"): self.__user.lastfm_status = False + self.__user.save() logger.warning("LastFM error %i: %s", json["error"], json["message"]) return json