From d467e2ceb7eed1e1b8b52b19ffed8d59e3d60ea1 Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 1 Jun 2020 21:45:11 +0300 Subject: [PATCH] If we already have the album, return early --- src/pylast/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py index 4befdb7..21e2140 100644 --- a/src/pylast/__init__.py +++ b/src/pylast/__init__.py @@ -2128,6 +2128,8 @@ class Track(_Opus): def get_album(self): """Returns the album object of this track.""" + if "album" in self.info and self.info["album"] is not None: + return Album(self.artist, self.info["album"], self.network) doc = self._request(self.ws_prefix + ".getInfo", True)