"""Quick probe scene API output."""
import sys
import uuid
from app.db import session_scope
from app.api.scenes import _build_scene_out
from app.models.scene import Scene

sid = uuid.UUID(sys.argv[1])
with session_scope() as s:
    sc = s.get(Scene, sid)
    if not sc:
        print("not found")
        sys.exit(0)
    out = _build_scene_out(s, sc)
    print(f"title: {out.title}")
    print(f"duration: {out.duration_sec}")
    print(f"playback_sources: {len(out.playback_sources)}")
    for p in out.playback_sources:
        thumb = p.thumbnail_url or "none"
        print(f"  origin={p.origin} thumb={thumb[:180]}")
