#!/usr/bin/env python3
"""
Batch comparison of Veo 3.1 fast vs standard models.
"""

import sys
import time
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent))
from compare_veo_models import run_comparison

# Recent tasks with proper metadata
TASKS = [
    # 16:9 landscape
    "/mnt/video/wb_42336282/20260122_113130_ugc0",
    "/mnt/video/wb_437256349/20260122_112431_j88o",
    # 9:16 portrait
    "/mnt/video/wb_235394056/20260122_125155_vf48",
    "/mnt/video/wb_213505276/20260122_112348_0wmj",
    "/mnt/video/wb_88074188/20260122_142034_fmd5",
    "/mnt/video/wb_231760526/20260122_104901_t1h8",
    "/mnt/video/wb_761708836/20260122_120434_endv",
    "/mnt/video/wb_572868935/20260121_231229_s718",
]

DELAY_BETWEEN_REQUESTS = 10  # seconds

def main():
    successful = []
    failed = []

    for i, task_path in enumerate(TASKS, 1):
        print(f"\n{'='*60}")
        print(f"[{i}/{len(TASKS)}] Processing: {task_path}")
        print('='*60)

        try:
            success = run_comparison(task_path)
            if success:
                successful.append(task_path)
            else:
                failed.append(task_path)
        except Exception as e:
            print(f"Error: {e}")
            failed.append(task_path)

        # Delay between requests to avoid rate limiting
        if i < len(TASKS):
            print(f"\nWaiting {DELAY_BETWEEN_REQUESTS}s before next request...")
            time.sleep(DELAY_BETWEEN_REQUESTS)

    print(f"\n{'='*60}")
    print("BATCH COMPLETE")
    print('='*60)
    print(f"\nSuccessful: {len(successful)}/{len(TASKS)}")
    print(f"Failed: {len(failed)}/{len(TASKS)}")

    if successful:
        print("\n--- Directories with generated standard videos ---")
        for path in successful:
            print(path)

    if failed:
        print("\n--- Failed ---")
        for path in failed:
            print(path)

if __name__ == "__main__":
    main()
