mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
feat(video-assets): add full video asset system (uploads, downloads, @mentions, and cleanup/billing integration)
This commit is contained in:
@@ -29,6 +29,8 @@ model User {
|
||||
workspaceMemberships WorkspaceMember[]
|
||||
projects Project[]
|
||||
comments Comment[]
|
||||
uploadedVideoAssets VideoAsset[] @relation("VideoAssetUploadedBy")
|
||||
billedVideoAssets VideoAsset[] @relation("VideoAssetBilledTo")
|
||||
projectMemberships ProjectMember[]
|
||||
notificationSetting NotificationSetting?
|
||||
watchProgress WatchProgress[]
|
||||
@@ -65,6 +67,17 @@ enum DownloadEgressSource {
|
||||
COMPRESSED
|
||||
}
|
||||
|
||||
enum VideoAssetKind {
|
||||
IMAGE
|
||||
VIDEO
|
||||
}
|
||||
|
||||
enum VideoAssetProvider {
|
||||
R2_IMAGE
|
||||
YOUTUBE
|
||||
BUNNY
|
||||
}
|
||||
|
||||
model DownloadEgressEvent {
|
||||
id String @id @default(cuid())
|
||||
versionId String
|
||||
@@ -303,6 +316,7 @@ model Video {
|
||||
|
||||
// Relations
|
||||
versions VideoVersion[]
|
||||
assets VideoAsset[]
|
||||
shareLinks ShareLink[]
|
||||
|
||||
@@index([projectId])
|
||||
@@ -345,6 +359,33 @@ model VideoVersion {
|
||||
@@map("video_versions")
|
||||
}
|
||||
|
||||
model VideoAsset {
|
||||
id String @id @default(cuid())
|
||||
videoId String
|
||||
video Video @relation(fields: [videoId], references: [id], onDelete: Cascade)
|
||||
kind VideoAssetKind
|
||||
provider VideoAssetProvider
|
||||
displayName String
|
||||
sourceUrl String
|
||||
providerVideoId String?
|
||||
thumbnailUrl String?
|
||||
uploadedByUserId String?
|
||||
uploadedByUser User? @relation("VideoAssetUploadedBy", fields: [uploadedByUserId], references: [id], onDelete: SetNull)
|
||||
uploadedByGuestIdentityId String?
|
||||
uploadedByGuestName String?
|
||||
billedUserId String
|
||||
billedUser User @relation("VideoAssetBilledTo", fields: [billedUserId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([videoId])
|
||||
@@index([billedUserId])
|
||||
@@index([provider])
|
||||
@@index([providerVideoId])
|
||||
@@index([videoId, createdAt(sort: Desc)])
|
||||
@@map("video_assets")
|
||||
}
|
||||
|
||||
model Comment {
|
||||
id String @id @default(cuid())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user