47 lines
1.6 KiB
Python
Executable File
47 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import sys
|
|
import json
|
|
|
|
# Add the signage_player directory to path
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'signage_player'))
|
|
|
|
from get_playlists import (
|
|
send_playlist_check_feedback,
|
|
send_playlist_restart_feedback,
|
|
send_playing_status_feedback
|
|
)
|
|
|
|
def load_config():
|
|
config_path = os.path.join(os.path.dirname(__file__), 'signage_player', 'main_data', 'app_config.txt')
|
|
with open(config_path, 'r') as f:
|
|
return json.load(f)
|
|
|
|
def test_feedback():
|
|
print("=== Testing Complete Feedback System ===")
|
|
|
|
config = load_config()
|
|
|
|
print("\n1. Server Interrogation Feedback:")
|
|
result1 = send_playlist_check_feedback(config, 6)
|
|
print(f" Result: {'✓ Success' if result1 else '❌ Failed'}")
|
|
|
|
print("\n2. Playlist Starting Feedback:")
|
|
result2 = send_playing_status_feedback(config, 6, "intro1.mp4")
|
|
print(f" Result: {'✓ Success' if result2 else '❌ Failed'}")
|
|
|
|
print("\n3. Playlist Working in Loop Feedback:")
|
|
result3 = send_playlist_restart_feedback(config, 6)
|
|
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"\nResults: {success_count}/3 successful")
|
|
|
|
if __name__ == "__main__":
|
|
test_feedback()
|