feat(bgm): 카테고리당 3개 다운로드 및 카테고리별 그룹화
- 카테고리당 BGM 3개씩 다운로드 기능 추가 - 파일명에 카테고리 prefix 추가 (예: upbeat_trackname.mp3) - 중복 BGM 자동 스킵 기능 - 프론트엔드에서 BGM을 카테고리별로 그룹화하여 표시 - 분류되지 않은 BGM은 '기타' 섹션에 표시 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,8 @@ class AutoBGMRequest(BaseModel):
|
||||
keywords: List[str] # Search keywords (from BGM recommendation)
|
||||
max_duration: int = 120
|
||||
commercial_only: bool = True # 상업적 사용 가능한 라이선스만
|
||||
count: int = 1 # Number of BGMs to download per request (default: 1)
|
||||
category: str | None = None # Category name to prefix filename (e.g., 'upbeat', 'chill')
|
||||
|
||||
|
||||
@router.get("/", response_model=list[BGMInfo])
|
||||
@@ -441,12 +443,17 @@ async def auto_download_bgm(request: AutoBGMRequest):
|
||||
|
||||
Set commercial_only=true (default) to only download CC0 licensed sounds
|
||||
that can be used commercially without attribution.
|
||||
|
||||
Set count to download multiple BGMs per category (default: 1).
|
||||
Existing BGMs with the same name are automatically skipped.
|
||||
"""
|
||||
success, message, file_path, matched_result = await search_and_download_bgm(
|
||||
keywords=request.keywords,
|
||||
output_dir=settings.BGM_DIR,
|
||||
max_duration=request.max_duration,
|
||||
commercial_only=request.commercial_only,
|
||||
count=request.count,
|
||||
category=request.category,
|
||||
)
|
||||
|
||||
if not success:
|
||||
|
||||
Reference in New Issue
Block a user