f10fd9cd5c
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Check push changed paths (push) Successful in 5s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 8s
CI/CD Pipeline / Build Staging API Image (push) Successful in 33s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 35s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 40s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 2m11s
CI/CD Pipeline / Validate - Style (push) Successful in 2m34s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 2m1s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m32s
CI/CD Pipeline / CI Gate (pull_request) Successful in 4s
CI/CD Pipeline / Integration Tests (push) Successful in 2m41s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m28s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m8s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m5s
AI Code Review / AI Code Review (pull_request) Successful in 6m28s
CI/CD Pipeline / Validate - Security (push) Successful in 7m1s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m40s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 7m40s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m22s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 5m29s
CI/CD Pipeline / Unit Tests (push) Successful in 13m51s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Failing after 302h57m45s
CI/CD Pipeline / Deploy Production (push) Failing after 302h57m47s
CI/CD Pipeline / CI Gate (push) Failing after 302h58m2s
CI/CD Pipeline / Build Production Web Image (push) Failing after 302h58m29s
CI/CD Pipeline / Build Production API Image (push) Failing after 302h58m30s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 303h9m36s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 303h10m7s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 303h11m26s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 303h10m7s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 303h10m14s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 303h11m35s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 303h11m27s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 303h11m35s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 303h11m28s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 303h12m14s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 303h12m28s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 303h11m30s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 303h12m28s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 303h11m36s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 303h12m28s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 303h11m36s
CI/CD Pipeline / Validate - Security (pull_request) Failing after 303h12m50s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 303h12m13s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 303h12m51s
CI/CD Pipeline / Frontend Lint (push) Failing after 303h12m54s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 303h12m56s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 303h12m51s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 303h12m57s
CI/CD Pipeline / PR Build API Image (push) Failing after 303h12m57s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 303h12m52s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 303h12m58s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 303h12m53s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 303h32m54s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 303h45m55s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 303h46m38s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 303h46m53s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Failing after 303h47m15s
CI/CD Pipeline / PR Build Web Image (push) Failing after 303h47m21s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
75 lines
2.2 KiB
Python
Executable File
75 lines
2.2 KiB
Python
Executable File
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from datetime import datetime, timezone
|
|
from typing import Any
|
|
from uuid import uuid4
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class GeneratedVideo:
|
|
id: str
|
|
project_id: str
|
|
generation_task_id: str
|
|
name: str
|
|
file_url: str
|
|
file_size: int
|
|
duration: float
|
|
width: int
|
|
height: int
|
|
fps: float
|
|
user_id: str = ""
|
|
thumbnail_url: str | None = None
|
|
status: str = "completed"
|
|
review_status: str = "pending_review"
|
|
generation_params: dict[str, Any] = field(default_factory=dict)
|
|
video_fingerprint: dict[str, Any] | None = None
|
|
is_duplicate: bool = False
|
|
duplicate_of: str | None = None
|
|
duplicate_rate: float | None = None
|
|
match_count: int = 0
|
|
visual_similarity: float = 0.0
|
|
generated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
|
created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
|
|
|
@classmethod
|
|
def create(
|
|
cls,
|
|
project_id: str,
|
|
generation_task_id: str,
|
|
name: str,
|
|
file_url: str,
|
|
*,
|
|
user_id: str = "",
|
|
file_size: int = 0,
|
|
duration: float = 0.0,
|
|
width: int = 0,
|
|
height: int = 0,
|
|
fps: float = 0.0,
|
|
thumbnail_url: str | None = None,
|
|
generation_params: dict[str, Any] | None = None,
|
|
) -> "GeneratedVideo":
|
|
if not project_id.strip():
|
|
raise ValueError("project_id cannot be empty")
|
|
if not generation_task_id.strip():
|
|
raise ValueError("generation_task_id cannot be empty")
|
|
if not name.strip():
|
|
raise ValueError("name cannot be empty")
|
|
if not file_url.strip():
|
|
raise ValueError("file_url cannot be empty")
|
|
return cls(
|
|
id=uuid4().hex,
|
|
project_id=project_id.strip(),
|
|
user_id=user_id.strip(),
|
|
generation_task_id=generation_task_id.strip(),
|
|
name=name.strip(),
|
|
file_url=file_url.strip(),
|
|
file_size=file_size,
|
|
duration=duration,
|
|
width=width,
|
|
height=height,
|
|
fps=fps,
|
|
thumbnail_url=thumbnail_url,
|
|
generation_params=generation_params or {},
|
|
)
|