31807f37bf
Repo hygiene: - Remove dead scripts (.wait-for-display, .display-keepalive, .keep-screen-alive) - Remove stale backup/scratch (install.sh.bak, New.txt, stale .pyc) - Stop tracking machine-specific/generated state (config/app_config.json, playlists/server_playlist.json, src/player_auth.json, generated launchers) - Prune duplicate wheel versions (one per package) - Reorganize working_files -> dev/, dev/tests/, documentation/dev-notes/, scripts/ - Extend .gitignore; fix no-op rules in repo/.gitignore Offline install (install.sh): - Non-fatal system-dep step; per-package apt retry; .deb bundle install - Skip pip self-upgrade offline; guard online fallbacks behind connectivity probe - Dependency-free fetch_url (curl/wget/urllib); --no-reboot flag - Fix corrupted literal backslash-bang escapes (shebangs, test -f, banner) - Idempotent cron install (no more stacked @reboot lines) Autostart / watchdog: - start.sh: single-instance flock lock (.player_watchdog.lock) acquired only after a display is confirmed, preventing parallel watchdogs - Set XDG_RUNTIME_DIR when missing; exit early if headless - run_player.sh: activate .venv; stop_player.sh: clear lock file
55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Force playlist update to download all files."""
|
|
|
|
import json
|
|
import sys
|
|
import os
|
|
|
|
# Add src directory to path
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
|
|
|
|
from get_playlists_v2 import update_playlist_if_needed
|
|
|
|
# Load config
|
|
config_file = 'config/app_config.json'
|
|
with open(config_file, 'r') as f:
|
|
config = json.load(f)
|
|
|
|
print("=" * 80)
|
|
print("FORCING PLAYLIST UPDATE")
|
|
print("=" * 80)
|
|
|
|
playlist_dir = 'playlists'
|
|
media_dir = 'media'
|
|
|
|
print(f"\nConfiguration:")
|
|
print(f" Playlist dir: {playlist_dir}")
|
|
print(f" Media dir: {media_dir}")
|
|
|
|
print("\n" + "=" * 80)
|
|
print("Updating playlist...")
|
|
print("=" * 80 + "\n")
|
|
|
|
result = update_playlist_if_needed(config, playlist_dir, media_dir)
|
|
|
|
if result:
|
|
print("\n" + "=" * 80)
|
|
print("SUCCESS!")
|
|
print("=" * 80)
|
|
print(f"✓ Playlist updated to: {result}")
|
|
|
|
# Check media directory
|
|
import os
|
|
media_files = sorted([f for f in os.listdir(media_dir) if not f.startswith('.')])
|
|
print(f"\n✓ Media files downloaded ({len(media_files)}):")
|
|
for f in media_files:
|
|
size = os.path.getsize(os.path.join(media_dir, f))
|
|
print(f" - {f} ({size:,} bytes)")
|
|
|
|
else:
|
|
print("\n" + "=" * 80)
|
|
print("FAILED or already up to date")
|
|
print("=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|