updated version
This commit is contained in:
@@ -17,29 +17,45 @@ def load_config():
|
||||
with open(config_path, 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
def get_current_playlist_version():
|
||||
"""Get the actual current playlist version from the system"""
|
||||
playlist_dir = os.path.join(os.path.dirname(__file__), 'signage_player', 'static_data', 'playlist')
|
||||
try:
|
||||
if os.path.exists(playlist_dir):
|
||||
playlist_files = [f for f in os.listdir(playlist_dir) if f.startswith('server_playlist_v') and f.endswith('.json')]
|
||||
if playlist_files:
|
||||
versions = [int(f.split('_v')[-1].split('.json')[0]) for f in playlist_files]
|
||||
return max(versions)
|
||||
return 1 # Default version if no files found
|
||||
except Exception as e:
|
||||
print(f"Error getting playlist version: {e}")
|
||||
return 1
|
||||
|
||||
def test_feedback():
|
||||
print("=== Testing Complete Feedback System ===")
|
||||
|
||||
config = load_config()
|
||||
current_version = get_current_playlist_version()
|
||||
|
||||
print(f"Current actual playlist version: v{current_version}")
|
||||
|
||||
print("\n1. Server Interrogation Feedback:")
|
||||
result1 = send_playlist_check_feedback(config, 6)
|
||||
result1 = send_playlist_check_feedback(config, current_version)
|
||||
print(f" Result: {'✓ Success' if result1 else '❌ Failed'}")
|
||||
|
||||
print("\n2. Playlist Starting Feedback:")
|
||||
result2 = send_playing_status_feedback(config, 6, "intro1.mp4")
|
||||
result2 = send_playing_status_feedback(config, current_version, "intro1.mp4")
|
||||
print(f" Result: {'✓ Success' if result2 else '❌ Failed'}")
|
||||
|
||||
print("\n3. Playlist Working in Loop Feedback:")
|
||||
result3 = send_playlist_restart_feedback(config, 6)
|
||||
result3 = send_playlist_restart_feedback(config, current_version)
|
||||
print(f" Result: {'✓ Success' if result3 else '❌ Failed'}")
|
||||
|
||||
success_count = sum([result1, result2, result3])
|
||||
print(f"\n=== Complete Feedback Coverage ===")
|
||||
print("✓ Server interrogation - when checking for new playlist")
|
||||
print("✓ Playlist starting - when first media begins")
|
||||
print("✓ Playlist working in loop - when playlist cycles complete")
|
||||
print("✓ Error reporting - when issues occur")
|
||||
print(f"\n=== Dynamic Version Feedback ===")
|
||||
print(f"✓ Using actual playlist version: v{current_version}")
|
||||
print("✓ Version updates automatically when playlist changes")
|
||||
print("✓ Server gets real-time version information")
|
||||
print(f"\nResults: {success_count}/3 successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user