From 8d784d6417da07dd147e025f34bd94bda910af64 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 22 Aug 2020 00:24:55 +0300 Subject: [PATCH] Return MBID None for 'Track not found' --- src/pylast/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py index fb2de22..39edd41 100644 --- a/src/pylast/__init__.py +++ b/src/pylast/__init__.py @@ -1592,7 +1592,10 @@ class _Opus(_BaseObject, _Taggable): def get_mbid(self): """Returns the MusicBrainz ID of the album or track.""" - doc = self._request(self.ws_prefix + ".getInfo", cacheable=True) + try: + doc = self._request(self.ws_prefix + ".getInfo", cacheable=True) + except WSError: + return None try: lfm = doc.getElementsByTagName("lfm")[0]