#bl_getter = next(fn for fn, bl in zip(bl_fun, boolgen) if bl is True)
bl_getter = next(dropwhile(lambda _: not next(boolgen), bl_fun))
#cls.log.debug('using {0} as bl filter'.format(bl_getter.__name__))
- results = func(*args, **kwargs)
- for elem in results:
+ results = list()
+ for elem in func(*args, **kwargs):
if bl_getter(elem, add_not=True):
- cls.log.info('Blacklisted: {0}'.format(elem))
- results.remove(elem)
+ cls.log.debug('Blacklisted "{0}"'.format(elem))
+ continue
if track and cls.database.get_bl_album(elem, add_not=True):
# filter album as well in track mode
# (artist have already been)
- cls.log.info('Blacklisted: {0}'.format(elem))
- results.remove(elem)
+ cls.log.debug('Blacklisted alb. "{0.album}"'.format(elem))
+ continue
+ results.append(elem)
return results
return wrapper
return decorated