MultimodalData / player /check_data.py
alinarus's picture
Upload folder using huggingface_hub (part 10)
d4159be verified
Raw History Blame Contribute Delete
1.02 kB
"""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())