]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed bug in MPD client reconnection
authorkaliko <kaliko@azylum.org>
Thu, 7 May 2020 15:35:56 +0000 (17:35 +0200)
committerkaliko <kaliko@azylum.org>
Thu, 7 May 2020 15:35:56 +0000 (17:35 +0200)
doc/Changelog
sima/core.py

index 42a6debdad3774a3edc2786b85c465025c4e638a..f0126f8db91253ac67b136f0aaec0570d05c3628 100644 (file)
@@ -1,7 +1,7 @@
 MPD_sima v0.15.4 UNRELEASED
 
  * Refactored random plugin
 MPD_sima v0.15.4 UNRELEASED
 
  * Refactored random plugin
- * 
+ * Fixed bug in MPD client reconnection
 
 -- kaliko jack <kaliko@azylum.org>
 
 
 -- kaliko jack <kaliko@azylum.org>
 
index 5ec0492f5b9c0f9dd9443e93cca49655a335d462..ead1ba8e9563d1e2ad61465854b508e192c596e3 100644 (file)
@@ -108,7 +108,7 @@ class Sima(Daemon):
     def queue(self):
         to_add = list()
         for plugin in self.plugins:
     def queue(self):
         to_add = list()
         for plugin in self.plugins:
-            self.log.info('running %s', plugin)
+            self.log.info('callback_need_track: %s', plugin)
             pl_candidates = getattr(plugin, 'callback_need_track')()
             if pl_candidates:
                 to_add.extend(pl_candidates)
             pl_candidates = getattr(plugin, 'callback_need_track')()
             if pl_candidates:
                 to_add.extend(pl_candidates)
@@ -177,8 +177,8 @@ class Sima(Daemon):
                 #TODO: unhandled Player exceptions
                 self.log.warning('Unhandled player exception: %s', err)
                 del self.player
                 #TODO: unhandled Player exceptions
                 self.log.warning('Unhandled player exception: %s', err)
                 del self.player
-                self.player = PlayerClient()
-                time.sleep(10)
+                self.player = self.__get_player()
+                time.sleep(5)
             except PlayerError as err:
                 self.log.warning('Player error: %s', err)
                 self.reconnect_player()
             except PlayerError as err:
                 self.log.warning('Player error: %s', err)
                 self.reconnect_player()