- def _get_history(self):
- """Constructs list of already played artists.
- """
- duration = self.daemon.config.getint('sima', 'history_duration')
- tracks_from_db = self.daemon.sdb.get_history(duration=duration)
- hist = [Track(file=tr[3], artist=tr[0]) for tr in tracks_from_db]
- return hist
+ def start(self):
+ if (0, 21, 0) > tuple(map(int, self.player.mpd_version.split('.'))):
+ self.log.warning('MPD protocol version: %s < 0.21.0',
+ self.player.mpd_version)
+ self.log.error(
+ 'Need at least MPD 0.21 to use Tags plugin (filters required)')
+ self.player.disconnect()
+ raise PluginException('MPD >= 0.21 required')
+ # Check filter is valid
+ try:
+ if self.plugin_conf['filter']:
+ # Use window to limit response size
+ self.player.find(self.plugin_conf['filter'], "window", (0, 1))
+ except CommandError:
+ raise PluginException('Badly formated filter in tags plugin configuration: "%s"'
+ % self.plugin_conf['filter'])