From 3bb93aa02d21c3d68575e47e91a0ffdf84e278d7 Mon Sep 17 00:00:00 2001 From: cwilvx Date: Sat, 7 Jun 2025 19:45:53 +0300 Subject: [PATCH] handle keyerror on last.fm plugin + remove docs sections on pyproject.toml --- pyproject.toml | 8 -------- swingmusic/plugins/lastfm.py | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 96bf1429..c47d49cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,14 +63,6 @@ dev = [ "pyinstaller==6.12.0", ] -docs = [ - "sphinx", - "furo", - "sphinx_design", - "myst_parser", - "sphinx", - "sphinx-autodoc2", -] [tool.setuptools] package-dir = {"swingmusic" = "swingmusic"} diff --git a/swingmusic/plugins/lastfm.py b/swingmusic/plugins/lastfm.py index a9cd56b7..f4a2b6f9 100644 --- a/swingmusic/plugins/lastfm.py +++ b/swingmusic/plugins/lastfm.py @@ -112,7 +112,11 @@ class LastFmPlugin(Plugin): if res_json["error"] == 9: log.error("LAST.FM: Invalid session key") # Invalid session key - self.config.lastfmSessionKeys.pop(str(get_current_userid())) + try: + self.config.lastfmSessionKeys.pop(str(get_current_userid())) + except KeyError: + pass + self.config.lastfmSessionKeys = self.config.lastfmSessionKeys return False