1 # -*- coding: utf-8 -*-
2 """Add playing tracks to history
5 # standard library import
7 # third parties components
10 from ..lib.plugin import Plugin
12 class History(Plugin):
16 def __init__(self, daemon):
17 Plugin.__init__(self, daemon)
19 self.player = daemon.player
22 self.log.info('Cleaning database')
23 self.sdb.purge_history()
24 self.sdb.clean_database()
26 def callback_next_song(self):
27 current = self.player.current
28 self.log.debug('add history: "{}"'.format(current))
29 self.sdb.add_history(current)
33 # vim: ai ts=4 sw=4 sts=4 expandtab