- played_art = self.get_played_artist()
- while artists:
- art = random.choice(artists)
- if self.daemon.sdb.get_bl_artist(art, add_not=True):
- self.log.debug('Random: Blacklisted "%s"', art)
- continue
- if art not in played_art:
- break
- artists.remove(art)
- elif self.mode == 'pure':
- art = random.choice(artists)
- if art is None:
- return None
- self.log.debug('Random art: {}'.format(art))
- trks = self.player.find_track(Artist(art))
- if trks:
- trk = random.choice(trks)
- self.log.info('Random candidate ({}): {}'.format(self.mode, trk))
- return trk
-
+ if self.daemon.sdb.get_bl_artist(artist, add_not=True):
+ self.log.debug('Random: Blacklisted "%s"', artist)
+ return True
+ if artist in self.get_played_artist():
+ return True
+ if artist in self.player.queue:
+ return True
+ if artist in self.candidates:
+ return True
+ return False