From e221626191b9b45b9778d7932c8164b31614fb36 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 10 Sep 2024 12:42:16 +0100 Subject: [PATCH] sync group --- player/player.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/player/player.py b/player/player.py index 769d8b2..51077d8 100755 --- a/player/player.py +++ b/player/player.py @@ -28,7 +28,8 @@ CONFIG = { "sub_border_color": "0.0/0.0/0.0/0.75", "sub_margin": 2 * 36 + 6, "sub_spacing": 0, - "vf": None + "vf": None, + "sync_group": None, } @@ -277,6 +278,8 @@ class Sync(Thread): "%0.4f %s" % (self.mpv.time_pos, self.mpv.playlist_current_pos) ).encode() + if CONFIG.get("sync_group"): + msg = (b"%s " % CONFIG["sync_group"]) + msg except: return try: @@ -307,6 +310,11 @@ class Sync(Thread): except OSError: logger.error("socket closed") else: + if CONFIG.get("sync_group"): + if data[0] != str(CONFIG["sync_group"]): + return self.read_position_main() + else: + data = data[1:] self._last_ping = data[0] if data[0] == "pause": self.is_paused = True