feat: add download_url field to generated video APIs #20

Merged
xiaoxia merged 88 commits from feature/video-download into develop 2026-06-26 21:13:18 +08:00
Owner

Summary

This PR adds download URL functionality to the generated videos API.

Changes

  1. Schema Update (apps/api/app/schemas/generated_video.py):

    • Added download_url: str | None = None field to GeneratedVideoResponse
  2. API Routes Update (apps/api/app/api/routes/generated_videos.py):

    • Modified _to_generated_video_response function to accept optional download_url parameter
    • Updated list_generated_videos endpoint to generate download URLs for each video
    • Updated get_generated_video endpoint to include download URL in response
    • Updated update_generated_video_review_status endpoint to include download URL in response
    • Kept existing get_generated_video_download_url endpoint for explicit download URL requests

API Response Examples

List Videos Response

{
  "items": [
    {
      "id": "...",
      "workspace_id": "...",
      "name": "...",
      "file_url": "...",
      "download_url": "https://...",  // New field
      ...
    }
  ]
}

Get Video Response

{
  "id": "...",
  "download_url": "https://...",  // New field
  ...
}

Technical Details

  • Uses existing OSSStorageService.get_download_url() to generate download URLs
  • Supports both OSS (Alibaba Cloud) and local file storage
  • Download URLs are signed with expiration time for OSS storage

Closes: MVP feature requirement for video download functionality

## Summary This PR adds download URL functionality to the generated videos API. ### Changes 1. **Schema Update** (`apps/api/app/schemas/generated_video.py`): - Added `download_url: str | None = None` field to `GeneratedVideoResponse` 2. **API Routes Update** (`apps/api/app/api/routes/generated_videos.py`): - Modified `_to_generated_video_response` function to accept optional `download_url` parameter - Updated `list_generated_videos` endpoint to generate download URLs for each video - Updated `get_generated_video` endpoint to include download URL in response - Updated `update_generated_video_review_status` endpoint to include download URL in response - Kept existing `get_generated_video_download_url` endpoint for explicit download URL requests ### API Response Examples #### List Videos Response ```json { "items": [ { "id": "...", "workspace_id": "...", "name": "...", "file_url": "...", "download_url": "https://...", // New field ... } ] } ``` #### Get Video Response ```json { "id": "...", "download_url": "https://...", // New field ... } ``` ### Technical Details - Uses existing `OSSStorageService.get_download_url()` to generate download URLs - Supports both OSS (Alibaba Cloud) and local file storage - Download URLs are signed with expiration time for OSS storage Closes: MVP feature requirement for video download functionality
xiaoxia added 86 commits 2026-06-26 20:07:48 +08:00
merge: release V21 UI and core E2E hardening
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 26s
Tests / test (push) Successful in 18s
Tests / lint (push) Successful in 10s
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Production Browser E2E (push) Failing after 1995h13m12s
Deploy / Deploy Production (push) Failing after 1995h13m14s
Deploy / Build Production Runtime Images (push) Failing after 1995h23m10s
31c0f23297
Merge develop into main through protected Gitea PR flow.
fix(ci): pass production API base to E2E
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 23s
Tests / test (push) Successful in 17s
Tests / lint (push) Successful in 10s
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Deploy Production (push) Failing after 1994h50m30s
Deploy / Build Production Runtime Images (push) Failing after 1995h0m15s
Deploy / Production Browser E2E (push) Failing after 1994h50m28s
b914f55b7d
Merge production E2E API base hotfix.
test(web): scope generation approval assertion
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 26s
Tests / test (push) Successful in 16s
Tests / lint (push) Successful in 11s
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Deploy Production (push) Failing after 1994h34m22s
Deploy / Build Production Runtime Images (push) Failing after 1994h44m9s
Deploy / Production Browser E2E (push) Failing after 1994h34m20s
2f9a1a42f5
Merge production E2E assertion hotfix.
test(web): target generation approval pill
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 26s
Tests / test (push) Successful in 17s
Tests / lint (push) Successful in 10s
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
Deploy / Deploy Staging (push) Failing after 1994h28m41s
06857d0a0d
Merge generation approval pill hotfix.
Merge pull request 'feat(web): complete V21 UI redesign' (#6) from develop into main
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 24s
Tests / test (push) Successful in 15s
Tests / lint (push) Successful in 8s
Deploy / Deploy Production (push) Failing after 1992h50m50s
Deploy / Production Browser E2E (push) Failing after 1992h19m30s
Deploy / Build Production Runtime Images (push) Failing after 1992h20m3s
Deploy / Deploy Staging (push) Failing after 1992h20m5s
a31145950f
fix(security): P0 - 日志过滤敏感参数(token/password/secret等)
Tests / lint (pull_request) Failing after 1965h44m58s
Tests / test (pull_request) Failing after 1965h45m58s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h46m58s
e58293a51f
feat(ui): V21 design system overhaul
Tests / lint (pull_request) Failing after 1965h39m14s
Tests / test (pull_request) Failing after 1965h40m15s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h41m15s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1965h42m15s
cae16d547e
fix: resolve CI check failures - format code and add nosec comment
Tests / lint (pull_request) Failing after 1965h12m20s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h14m4s
Tests / test (pull_request) Failing after 1965h13m4s
950f63bb69
fix: resolve CI check failures - format code and add nosec comment
Tests / lint (pull_request) Failing after 1965h12m14s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h12m18s
Tests / test (pull_request) Failing after 1965h12m16s
071f0e990e
fix: resolve CI check failures - format code and fix line length issues
Tests / lint (pull_request) Failing after 1965h12m8s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h12m12s
Tests / test (pull_request) Failing after 1965h12m10s
3d29dc0c83
fix: resolve CI check failures - format code and fix line length issues
Tests / lint (pull_request) Failing after 1965h12m4s
Tests / test (pull_request) Failing after 1965h12m4s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h12m6s
a4f721528e
ci: enable auto-deploy for feature branches
Tests / lint (pull_request) Failing after 1965h11m58s
Tests / test (pull_request) Failing after 1965h12m0s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h12m2s
a0f8540a09
Merge pull request 'ci: enable auto-deploy for feature branches' (#10) from ci/enable-feature-deploy into main
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lint (push) Has been cancelled
a717dd17c8
Merge pull request 'fix(security): P0 - JWT密钥强制环境变量 + 日志敏感信息过滤' (#8) from fix/security-p0-jwt-logging into main
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lint (push) Has been cancelled
f34f654a84
Merge pull request 'feat(ui): V21 design system overhaul' (#9) from feature/v21-design-system into main
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lint (push) Has been cancelled
53055afa43
fix(p1): resolve 4 P1 technical debt issues
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h11m56s
Tests / lint (pull_request) Failing after 1965h11m52s
Tests / test (pull_request) Failing after 1965h11m54s
7fa327aa27
- P1-1: CORS configuration security - use DEBUG mode to differentiate
  production vs development CORS settings
- P1-2: Implement token refresh logic in RefreshTokenUseCase
  - Add get_session_by_refresh_token to SessionStore
  - Verify session validity and expiry
  - Generate new access token on refresh
- P1-3: Fix database connection leak in worker ingest task
  - Add proper try-except-finally block
  - Ensure db.close() is always called
- P1-4: Implement real media metadata extraction
  - Use ffprobe for video metadata
  - Use Pillow for image metadata
  - Return empty dict on failure (no mock data)
Merge pull request 'fix(p1): 修复 4 个 P1 技术债务问题' (#11) from fix/p1-technical-debt into main
Tests / lint (push) Failing after 1965h11m46s
Tests / test (push) Failing after 1965h11m48s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1965h11m50s
13113f50c5
chore: update .gitignore for temp files
Tests / lint (pull_request) Failing after 1965h5m32s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1965h5m36s
Tests / test (pull_request) Failing after 1965h5m34s
55d2b25f08
Merge pull request 'chore: 清理仓库 - 删除过时文件和已合并分支' (#13) from chore/repo-cleanup into main
Tests / lint (push) Failing after 1965h0m22s
Tests / test (push) Failing after 1965h0m24s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1965h0m24s
3c54dcbef4
P3-5: 添加 tests/integration/test_auth.py 认证集成测试
Tests / lint (pull_request) Failing after 1964h50m50s
Tests / test (pull_request) Failing after 1964h50m52s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1964h50m54s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1964h50m54s
b300f66630
fix(ci): remove container field to run on host directly
Tests / lint (pull_request) Failing after 1964h50m26s
Tests / test (pull_request) Failing after 1964h50m28s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1964h50m30s
8575ee772f
Merge pull request 'fix: 移除 CI container 配置,直接在 host 运行' (#16) from fix/ci-remove-container into main
Tests / lint (push) Failing after 1964h50m8s
Tests / test (push) Failing after 1964h50m9s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1964h50m10s
c393c38d89
Merge pull request 'chore: 修复 P2/P3 技术债务' (#15) from fix/p2p3-tech-debt-v2 into main
Tests / lint (push) Failing after 1964h49m9s
Tests / test (push) Failing after 1964h49m10s
CI/CD Pipeline / Frontend Lint (push) Failing after 1964h49m12s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1964h49m14s
f2fe27eda6
fix(deploy): use ubuntu-latest runner label
Tests / lint (pull_request) Failing after 1964h46m42s
Tests / test (pull_request) Failing after 1964h46m44s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1964h46m46s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1964h46m47s
1ba3543fa0
Merge pull request 'fix: 部署workflow使用ubuntu-latest runner label' (#17) from fix/deploy-runner-label into main
Tests / lint (push) Failing after 1964h46m10s
CI/CD Pipeline / Frontend Lint (push) Failing after 1964h46m14s
Tests / test (push) Failing after 1964h46m12s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1964h46m16s
42c543917e
chore: trigger CI/Deploy pipeline test
Tests / lint (push) Failing after 1964h38m38s
Tests / test (push) Failing after 1964h38m40s
CI/CD Pipeline / Frontend Lint (push) Failing after 1964h38m42s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1964h38m44s
dbf2092e89
feat: add download_url field to generated video APIs
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1963h22m58s
CI/CD Pipeline / Frontend Lint (push) Failing after 1963h23m8s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1963h23m9s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1963h23m0s
4d9c201858
- Add download_url field to GeneratedVideoResponse schema
- Generate download URLs for list, detail and review APIs
- Keep existing download-url endpoint for explicit download URL requests
xiaoxia added 1 commit 2026-06-26 21:11:54 +08:00
chore: merge develop into feature/video-download
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Waiting to run
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
4a45e23302
xiaoxia added 1 commit 2026-06-26 21:13:13 +08:00
chore: merge develop into feature/video-download (fix conflict)
CI/CD Pipeline / Validate Code Quality And Tests (push) Waiting to run
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Waiting to run
55fad055d3
xiaoxia merged commit 5dbde7e176 into develop 2026-06-26 21:13:18 +08:00
Sign in to join this conversation.