updated feedback

This commit is contained in:
2025-09-08 15:19:47 +03:00
parent e2eecb9cf9
commit 5063b47a56
9 changed files with 463 additions and 30 deletions

View File

@@ -4,7 +4,7 @@ import tkinter as tk
import vlc
import subprocess
import sys
from get_playlists import send_playlist_restart_feedback, send_player_error_feedback, send_playing_status_feedback
from get_playlists import send_playlist_restart_feedback, send_player_error_feedback, send_playing_status_feedback, send_playlist_check_feedback
CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'main_data', 'app_config.txt')
PLAYLIST_DIR = os.path.join(os.path.dirname(__file__), 'static_data', 'playlist')
@@ -90,6 +90,14 @@ class SimpleTkPlayer:
except Exception as e:
print(f"[FEEDBACK] Error sending restart feedback: {e}")
def send_server_check_feedback(self):
"""Send server interrogation feedback"""
try:
if self.config:
send_playlist_check_feedback(self.config, self.playlist_version)
except Exception as e:
print(f"[FEEDBACK] Error sending server check feedback: {e}")
def ensure_fullscreen(self):
self.root.attributes('-fullscreen', True)
self.root.update_idletasks()
@@ -323,8 +331,9 @@ class SimpleTkPlayer:
ext = file_path.lower()
duration = media.get('duration', None)
# Send playing status feedback
self.send_playing_feedback(media['file_name'])
# Only send playing status feedback when starting the first media (playlist start)
if self.current_index == 0:
self.send_playing_feedback(media['file_name'])
if not os.path.isfile(file_path):
print(f"[PLAYER] File missing: {file_path}. Skipping to next.")
@@ -519,7 +528,7 @@ class SimpleTkPlayer:
self.current_index = (self.current_index + 1) % len(self.playlist)
print(f"[PLAYER] Moving to next media: index {self.current_index}")
# Send feedback if playlist restarted
# Send feedback if playlist restarted (loop completed)
if was_at_end and self.current_index == 0:
print("[FEEDBACK] Playlist loop completed, sending restart feedback")
self.send_restart_feedback()