From c41197cc5cfea2d10f159d6fa523dd789934cc30 Mon Sep 17 00:00:00 2001 From: gdtwst Date: Sun, 7 Apr 2019 08:38:40 +0700 Subject: [PATCH] Re-add fixes from #2707 --- beetsplug/mpdstats.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index 423cde2b8..876dcacdd 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -256,10 +256,6 @@ class MPDStats(object): if not path: return - if is_url(path): - self._log.info(u'playing stream {0}', displayable_path(path)) - return - played, duration = map(int, status['time'].split(':', 1)) remaining = duration - played @@ -276,6 +272,14 @@ class MPDStats(object): if diff <= self.time_threshold: return + if self.now_playing['path'] == path and played == 0: + self.handle_song_change(self.now_playing) + + if is_url(path): + self._log.info(u'playing stream {0}', displayable_path(path)) + self.now_playing = None + return + self._log.info(u'playing {0}', displayable_path(path)) self.now_playing = {