From 69cc18bcbd7923a53287ba4d4e2102e1b6bf83c8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 22 Aug 2020 00:44:13 +0300 Subject: [PATCH] And only if track not found. Keep raise for invalid API key, etc. --- src/pylast/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py index 39edd41..b3497aa 100644 --- a/src/pylast/__init__.py +++ b/src/pylast/__init__.py @@ -1594,8 +1594,10 @@ class _Opus(_BaseObject, _Taggable): try: doc = self._request(self.ws_prefix + ".getInfo", cacheable=True) - except WSError: - return None + except WSError as e: + if int(e.get_id()) == STATUS_INVALID_PARAMS and str(e) == "Track not found": + return None + raise try: lfm = doc.getElementsByTagName("lfm")[0]