"""Check the portable data/cache pairing without starting the native viewer.""" from pathlib import Path import sys import traceback ROOT = Path(__file__).resolve().parents[1] def main(): try: from customer_library import discover print(f'Data: {ROOT / "data"}', flush=True) print(f'Prepared caches: {ROOT / "player/runtime/cache"}', flush=True) items, problems = discover(ROOT / 'data') print(f'Compatible episodes: {len(items)}', flush=True) if problems: for problem in problems[:10]: print(f'{problem["episode"]}: {problem["error"]}', flush=True) print('See player/player-cache/customer/catalog.json for the complete report.') return 1 print('PASS: all discovered episodes have compatible prepared caches.') print('No data or prepared cache files were changed.') return 0 except Exception: traceback.print_exc() return 1 if __name__ == '__main__': sys.exit(main())