1 # -*- coding: utf-8 -*-
3 Deal with MPD options ‑ idle and repeat mode
6 # standard library import
8 # third parties components
11 from ...lib.plugin import Plugin
14 class MpdOptions(Plugin):
16 Deal with MPD options ‑ idle and repeat mode
19 def __init__(self, daemon):
20 Plugin.__init__(self, daemon)
23 def callback_player(self):
25 Called on player changes
27 player = self.daemon.player
28 if player.status().get('single') == str(1):
29 self.log.info('MPD "single" mode activated.')
30 self.daemon.enabled = False
31 elif player.status().get('repeat') == str(1):
32 self.log.info('MPD "repeat" mode activated.')
33 self.daemon.enabled = False
35 if self.daemon.enabled is False:
36 self.log.debug('enabling queuing (leaving single|repeat mode)')
37 self.daemon.enabled = True
44 # vim: ai ts=4 sw=4 sts=4 expandtab