1 # -*- coding: utf-8 -*-
5 # standard library import
7 # third parties components
10 from ..lib.plugin import Plugin
13 class MpdOptions(Plugin):
15 Deal with MPD options ‑ idle and repeat mode
18 def __init__(self, daemon):
19 Plugin.__init__(self, daemon)
22 def callback_player(self):
24 Called on player changes
26 player = self.daemon.player
27 if player.status().get('single') == str(1):
28 self.log.info('MPD "single" mode activated.')
29 self.daemon.enabled = False
30 elif player.status().get('repeat') == str(1):
31 self.log.info('MPD "repeat" mode activated.')
32 self.daemon.enabled = False
34 self.daemon.enabled = True
41 # vim: ai ts=4 sw=4 sts=4 expandtab