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:
+9
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user