self.log.debug('Searching album for %s aliases: "%s"',
artist, artist.aliases)
for name_sz in artist.names_sz:
- raw_albums = self.list('album', f"( albumartist == '{name_sz}')")
- albums = [Album(a, albumartist=artist.name, artist=artist) for a in raw_albums if a]
+ mpd_filter = f"((albumartist == '{name_sz}') AND ( album != ''))"
+ raw_albums = self.list('album', mpd_filter)
+ albums = [Album(a, albumartist=artist.name, artist=artist) for a in raw_albums]
candidates = []
for album in albums:
album_trks = self.find_tracks(album)
self.candidates = []
trks = []
target = self.plugin_conf.getint('track_to_add')
- artists = self.player.list('artist')
+ artists = self.player.list('artist', '( artist != "")')
random.shuffle(artists)
for art in artists:
if self.filtered_artist(art):
else:
mpd_filter.append(f"({tag} == '{cfg[tag].strip()}')")
mpd_filter = ' AND '.join(mpd_filter)
- if 'AND' in mpd_filter:
- mpd_filter = f'({mpd_filter})'
+ # Ensure there is at least an artist name
+ mpd_filter = f"({mpd_filter} AND (artist != ''))"
return mpd_filter