"""파이프라인 산출물 디렉토리 관리."""
import os

VIDEO_DATA_DIR = os.getenv("VIDEO_DATA_DIR", "/app/data/videos")
VIDEO_MEDIA_BASE = os.getenv("VIDEO_MEDIA_BASE", "/media/videos")


def pipeline_dir(pipeline_id: int) -> str:
    path = os.path.join(VIDEO_DATA_DIR, str(pipeline_id))
    os.makedirs(path, exist_ok=True)
    return path


def media_url(pipeline_id: int, filename: str) -> str:
    return f"{VIDEO_MEDIA_BASE}/{pipeline_id}/{filename}"
