From e7209a4f35005a16c32b2c9424b8effe849a2bef Mon Sep 17 00:00:00 2001 From: hhm Date: Wed, 15 Feb 2017 16:46:27 -0500 Subject: [PATCH] B"H get_raw_albums --- mopidy_subidy/subsonic_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 001aa78..dfc8940 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -197,7 +197,18 @@ class SubsonicApi(): return None def get_raw_albums(self, artist_id): - return self.get_raw_dir(artist_id) + try: + response = self.connection.getArtist(artist_id) + except Exception as e: + logger.warning('Connecting to subsonic failed when loading list of albums.') + return [] + if response.get('status') != RESPONSE_OK: + logger.warning('Got non-okay status code from subsonic: %s' % response.get('status')) + return [] + albums = response.get('artist').get('album') + if albums is not None: + return albums + return [] def get_raw_songs(self, album_id): try: