diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 24fb1fd..57a7609 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -48,6 +48,7 @@ model Artwork { gallery Gallery? @relation(fields: [galleryId], references: [id]) metadata ArtworkMetadata? + timelapse ArtworkTimelapse? albums Album[] categories ArtCategory[] @@ -195,6 +196,22 @@ model ArtworkMetadata { artwork Artwork @relation(fields: [artworkId], references: [id]) } +model ArtworkTimelapse { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + artworkId String @unique + artwork Artwork @relation(fields: [artworkId], references: [id], onDelete: Cascade) + + enabled Boolean @default(false) + + s3Key String @unique + fileName String? + mimeType String? + sizeBytes Int? +} + model FileData { id String @id @default(cuid()) createdAt DateTime @default(now()) @@ -353,14 +370,14 @@ model CommissionTypeCustomInput { model CommissionRequest { id String @id @default(cuid()) + index Int @default(autoincrement()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - sortIndex Int @default(0) customerName String customerEmail String message String - status String @default("NEW") // NEW | REVIEWING | ACCEPTED | REJECTED | SPAM + status String @default("NEW") customerSocials String? ipAddress String? @@ -422,6 +439,11 @@ model User { sessions Session[] accounts Account[] + role String @default("user") + banned Boolean? @default(false) + banReason String? + banExpires DateTime? + @@unique([email]) @@map("user") } @@ -437,6 +459,8 @@ model Session { userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) + impersonatedBy String? + @@unique([token]) @@index([userId]) @@map("session") diff --git a/src/app/(normal)/artworks/single/[id]/page.tsx b/src/app/(normal)/artworks/single/[id]/page.tsx index b7ce25d..fe29d26 100644 --- a/src/app/(normal)/artworks/single/[id]/page.tsx +++ b/src/app/(normal)/artworks/single/[id]/page.tsx @@ -1,7 +1,10 @@ import ArtworkMetaCard from "@/components/artworks/ArtworkMetaCard"; +import ArtworkTimelapseViewer from "@/components/artworks/ArtworkTimelapseViewer"; import { ContextBackButton } from "@/components/artworks/ContextBackButton"; +import { Button } from "@/components/ui/button"; import { prisma } from "@/lib/prisma"; import { cn } from "@/lib/utils"; +import { PlayCircle } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; @@ -19,7 +22,8 @@ export default async function SingleArtworkPage({ params }: { params: { id: stri categories: true, colors: { include: { color: true } }, tags: true, - variants: true + variants: true, + timelapse: true, } }) @@ -62,6 +66,20 @@ export default async function SingleArtworkPage({ params }: { params: { id: stri + {artwork.timelapse?.enabled ? ( +