B"H add album songs retrieval
This commit is contained in:
parent
68d469bdeb
commit
a9aa13cdb0
1 changed files with 12 additions and 1 deletions
|
@ -200,7 +200,18 @@ class SubsonicApi():
|
|||
return self.get_raw_dir(artist_id)
|
||||
|
||||
def get_raw_songs(self, album_id):
|
||||
return self.get_raw_dir(album_id)
|
||||
try:
|
||||
response = self.connection.getAlbum(album_id)
|
||||
except Exception as e:
|
||||
logger.warning('Connecting to subsonic failed when loading list of songs in album.')
|
||||
return []
|
||||
if response.get('status') != RESPONSE_OK:
|
||||
logger.warning('Got non-okay status code from subsonic: %s' % response.get('status'))
|
||||
return []
|
||||
songs = response.get('album').get('song')
|
||||
if songs is not None:
|
||||
return songs
|
||||
return []
|
||||
|
||||
def get_albums_as_refs(self, artist_id):
|
||||
return [self.raw_album_to_ref(album) for album in self.get_raw_albums(artist_id)]
|
||||
|
|
Loading…
Add table
Reference in a new issue