From bda454e619617e94303ddbad3601f5ee4fb2edc8 Mon Sep 17 00:00:00 2001 From: kaliko Date: Mon, 19 Apr 2021 16:38:12 +0200 Subject: [PATCH] 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. --- doc/Changelog | 1 + sima/plugins/core/uniq.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5