#!/usr/bin/env python3
"""回填 multi_demand_video_detail 的灵感点/目的点/关键点
（decode_result.灵感点 / 目的点 / 关键点，每项保留 点/点描述）。

用法:
    python jobs/backfill_multi_demand_video_points.py
    python jobs/backfill_multi_demand_video_points.py 100   # 每批 100
"""

from __future__ import annotations

import logging
import sys

from supply_infra.scheduler.jobs.sync_multi_demand_videos import (
    VIDEO_SYNC_BATCH_SIZE,
    backfill_video_points,
)

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
)


def main(batch_arg: str | None = None) -> dict:
    batch_size = int(batch_arg) if batch_arg else VIDEO_SYNC_BATCH_SIZE
    result = backfill_video_points(batch_size=batch_size)
    print(result)
    return result


if __name__ == "__main__":
    main(sys.argv[1] if len(sys.argv) > 1 else None)
