X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Fcore%2Funiq.py;h=292de6f6f38e09ac8e76c319959fb38e863ab724;hb=5aa6ec2f4b449797fbe8269c0d8d7da66bd2c9bc;hp=0f42718ed992b89f8516788ea525e275269d773c;hpb=ac0d934fc127484a0ed14386e4c4ecd4f915b6ca;p=mpd-sima.git diff --git a/sima/plugins/core/uniq.py b/sima/plugins/core/uniq.py index 0f42718..292de6f 100644 --- a/sima/plugins/core/uniq.py +++ b/sima/plugins/core/uniq.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2014 Jack Kaliko +# Copyright (c) 2014, 2020 kaliko # # This file is part of sima # @@ -30,6 +30,7 @@ from socket import getfqdn # third parties components # local import +from ...mpdclient import PlayerError from ...lib.plugin import Plugin @@ -70,9 +71,12 @@ class Uniq(Plugin): self.log.warning(' '.join(channels)) def sub_chan(self): - self.log.debug('Registering as {}'.format(self.chan)) - self.player.subscribe(self.chan) - self._registred = True + self.log.debug('Registering as %s', self.chan) + try: + self.player.subscribe(self.chan) + self._registred = True + except PlayerError as err: + self.log.error('Failed to register: %s', err) def callback_need_track(self): if self.is_capable():