# -*- coding: utf-8 -*-
-# Copyright (c) 2009-2020 kaliko <kaliko@azylum.org>
+# Copyright (c) 2009-2021 kaliko <kaliko@azylum.org>
# Copyright (c) 2019 sacha <sachahony@gmail.com>
#
# This file is part of sima
continue
nb_album_add += 1
candidates = self.player.find_tracks(album)
+ if not candidates:
+ continue
if self.plugin_conf.getboolean('shuffle_album'):
random.shuffle(candidates)
# this allows to select a maximum number of track from the album
to_add.extend(candidates)
if nb_album_add == target_album_to_add:
return to_add
+ return to_add
def find_top(self, artists):
"""
nbtracks_target = self.plugin_conf.getint('track_to_add')
for artist in artists:
if len(to_add) == nbtracks_target:
- return to_add
+ break
self.log.info('Looking for a top track for %s', artist)
titles = deque()
try:
if top_trk:
to_add.append(top_trk)
break
+ return to_add
def _track(self):
"""Get some tracks for track queue mode