Exclude empty albums from candidates
@@ -733,8 +733,9 @@ class MetadataSourcePlugin(object):
query_filters = {'album': album}
if not va_likely:
query_filters['artist'] = artist
- albums = self._search_api(query_type='album', filters=query_filters)
- return [self.album_for_id(album_id=a['id']) for a in albums]
+ results = self._search_api(query_type='album', filters=query_filters)
+ albums = [self.album_for_id(album_id=r['id']) for r in results]
+ return [a for a in albums if a is not None]
def item_candidates(self, item, artist, title):
"""Returns a list of TrackInfo objects for Search API results
