Fix infinite recursion when restarting player with empty playlist

- Added empty playlist guard in play_current_media() to return
  early instead of calling restart_playlist()
- Added empty playlist guard in restart_playlist() to return
  early instead of calling play_current_media()
- Wrapped SettingsPopup content in ScrollView so fields
  are not cut off on smaller screens
This commit is contained in:
ske087
2026-07-24 09:53:29 +03:00
parent 3845830a86
commit 362f5096a0
2 changed files with 302 additions and 281 deletions
+9 -1
View File
@@ -1299,7 +1299,11 @@ class SignagePlayer(Widget):
Logger.debug(f"SignagePlayer: Skipping play_current_media - player is paused")
return
if not self.playlist or self.current_index >= len(self.playlist):
if not self.playlist:
Logger.warning("SignagePlayer: Cannot play - playlist is empty")
return
if self.current_index >= len(self.playlist):
# End of playlist, restart
self.restart_playlist()
return
@@ -2068,6 +2072,10 @@ class SignagePlayer(Widget):
def restart_playlist(self):
"""Restart playlist from beginning"""
if not self.playlist:
Logger.warning("SignagePlayer: Cannot restart - playlist is empty")
return
Logger.info("SignagePlayer: Restarting playlist")
# Send restart feedback asynchronously (non-blocking)