From 60bd70704ff1f43945faa354649f9456a3b220ea Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Nov 2023 23:46:07 +0100 Subject: [PATCH] quick if stuck --- player/play-back.desktop | 2 +- player/play-front.desktop | 2 +- player/player-back.service | 2 +- player/player.py | 8 ++------ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/player/play-back.desktop b/player/play-back.desktop index 7f0d328..e6d630f 100644 --- a/player/play-back.desktop +++ b/player/play-back.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Exec=/srv/pandora/t_for_time/player/player.py --mode main --playlist /srv/t_for_time/render/back.m3u +Exec=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/back.m3u Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true diff --git a/player/play-front.desktop b/player/play-front.desktop index 2e53b85..6f95628 100644 --- a/player/play-front.desktop +++ b/player/play-front.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Exec=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/front.m3u +Exec=/srv/pandora/t_for_time/player/player.py --mode main --playlist /srv/t_for_time/render/front.m3u Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true diff --git a/player/player-back.service b/player/player-back.service index c2ded19..1ae4193 100644 --- a/player/player-back.service +++ b/player/player-back.service @@ -5,7 +5,7 @@ Description=player Type=simple Restart=always KillSignal=SIGINT -ExecStart=/srv/pandora/t_for_time/player/player.py --mode peer--playlist /srv/t_for_time/render/back.m3u +ExecStart=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/back.m3u [Install] WantedBy=default.target diff --git a/player/player.py b/player/player.py index 5376dae..89395d3 100755 --- a/player/player.py +++ b/player/player.py @@ -77,13 +77,10 @@ class Sync(Thread): self.read_position_main() #self.adjust_position() self.reload_playlist() - if self._tick and abs(time.time() - self._tick) > 10: + if self._tick and abs(time.time() - self._tick) > 60: logger.error("player is stuck") self._tick = 0 - self.mpv.loadlist(self.playlist) - self.mpv.playlist_play_index(0) - self.mpv.pause = False - self.mpv.wait_until_playing() + self.quit() def q_binding(self, *args): self.stop() @@ -158,7 +155,6 @@ class Sync(Thread): data = self.sock.recvfrom(1024)[0].decode().split(" ", 1) except socket.timeout: logger.error("failed to receive data from main") - return self.read_position_main() else: self.main.time_pos = float(data[0]) self.main.playlist_current_pos = int(data[1])