X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Fcore%2Funiq.py;h=5a74170fbda2454228490a4001f5d3b41c2242ca;hb=751e07b3e43a4812c29f1c89f03e58023278b634;hp=0f42718ed992b89f8516788ea525e275269d773c;hpb=ac0d934fc127484a0ed14386e4c4ecd4f915b6ca;p=mpd-sima.git diff --git a/sima/plugins/core/uniq.py b/sima/plugins/core/uniq.py index 0f42718..5a74170 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 @@ -71,8 +72,11 @@ class Uniq(Plugin): def sub_chan(self): self.log.debug('Registering as {}'.format(self.chan)) - self.player.subscribe(self.chan) - self._registred = True + 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():