From: kaliko Date: Mon, 19 Apr 2021 14:38:12 +0000 (+0200) Subject: Fixed bad pid in Uniq core plugin (closes #32) X-Git-Tag: 0.17.0~14 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=bda454e619617e94303ddbad3601f5ee4fb2edc8;p=mpd-sima.git Fixed bad pid in Uniq core plugin (closes #32) When daemonized the PID advertised by the plugin (channel's name) was the PID before the double fork and not the actual daemon's PID. --- diff --git a/doc/Changelog b/doc/Changelog index b8ed55c..0180c8f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,7 @@ MPD_sima v0.16.2.dev0 * Add randomness in Tags plugin artist selection * Fixed issue with un-tagged titles (closes #40) * Fixed "artist with quotes not found" (closes #41) + * Fixed bad pid in Uniq core plugin (closes #32) -- kaliko UNRELEASED diff --git a/sima/plugins/core/uniq.py b/sima/plugins/core/uniq.py index 60d1680..bc2ef54 100644 --- a/sima/plugins/core/uniq.py +++ b/sima/plugins/core/uniq.py @@ -41,7 +41,7 @@ class Uniq(Plugin): def __init__(self, daemon): Plugin.__init__(self, daemon) - self.chan = 'mpd_sima:{0}.{1}'.format(getfqdn(), getpid()) + self.chan = None self.channels = [] self._registred = False @@ -70,6 +70,7 @@ class Uniq(Plugin): self.log.warning(' '.join(channels)) def sub_chan(self): + self.chan = 'mpd_sima:{0}.{1}'.format(getfqdn(), getpid()) self.log.debug('Registering as %s', self.chan) try: self.player.subscribe(self.chan)