# description: TBD
depth = 1
-## SINGLE_ALBUM # NOT IMPLEMENTED #
+## SINGLE_ALBUM
# type: boolean
# scope: "track" and "top" queue modes
# description: Prevent from queueing a track from the same album (for instance with OST).
-single_album = true
+single_album = false
## TRACK_TO_ADD
# type: integer
logger.info('Starting...')
sima = core.Sima(config)
- # core plugins
+ # required core plugins
sima.register_plugin(History)
sima.register_plugin(MpdOptions)
sima.foreground()
except KeyboardInterrupt:
logger.info('Caught KeyboardInterrupt, stopping')
- #sima.shutdown()
+ sima.shutdown()
def run():
self.log.info('The way is shut, it was made by those who are dead. '
'And the dead keep it…')
self.log.info('bye...')
- sys.exit(0)
def run(self):
"""
conf = self.__daemon.config
for sec in conf.sections():
if sec.lower() == self.__class__.__name__.lower():
- self.plugin_conf = dict(conf.items(sec))
+ self.plugin_conf = conf[sec]
#if self.plugin_conf:
# self.log.debug('Got config for {0}: {1}'.format(self,
# self.plugin_conf))
if self.sdb.get_bl_album(trk, add_not=True):
self.log.info('Blacklisted album: {0}: '.format(trk))
continue
+ # Should use albumartist heuristic as well
+ if self.plugin_conf.getboolean('single_album'):
+ if (trk.album == self.player.current.album or
+ trk.album in [trk.alb for trk in self.to_add]):
+ self.log.debug('Found unplayed track ' +
+ 'but from an album already queued: %s' % (trk))
+ continue
candidate.append(trk)
if not candidate:
self.log.debug('Unable to find title to add' +
## Only error message will be printed with DEBUG="0"
-PY3=${PY3:-$(which python3.3)}
+PY3=${PY3:-$(which python3)}
# Test virtualenv presence
[ -x "$(which virtualenv)" ] || { echo "Cannot find virtualenv executable!"; exit 1; }