diff --git a/app/package-lock.json b/app/package-lock.json index ec99980..8efcdb6 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -44,6 +44,7 @@ "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "uploadthing": "^6.13.2", + "uuid": "^11.0.3", "zod": "^3.23.8" }, "devDependencies": { @@ -9060,6 +9061,19 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/uuid": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", + "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", diff --git a/app/package.json b/app/package.json index 1e4a14b..8e28aa7 100644 --- a/app/package.json +++ b/app/package.json @@ -45,6 +45,7 @@ "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "uploadthing": "^6.13.2", + "uuid": "^11.0.3", "zod": "^3.23.8" }, "devDependencies": { diff --git a/app/src/app/api/uploadthing/core.ts b/app/src/app/api/uploadthing/core.ts index a05467e..8974ba8 100644 --- a/app/src/app/api/uploadthing/core.ts +++ b/app/src/app/api/uploadthing/core.ts @@ -12,11 +12,11 @@ export const ourFileRouter = { { audio: { maxFileCount: 1, - maxFileSize: "1024MB" + maxFileSize: "16MB" }, video: { maxFileCount: 1, - maxFileSize: "1024MB" + maxFileSize: "16MB" } }) // Set permissions and file types for this FileRoute diff --git a/app/src/app/transcriptions/[transcription_id]/page.tsx b/app/src/app/transcriptions/[transcription_id]/page.tsx index fa09f62..ce1346e 100644 --- a/app/src/app/transcriptions/[transcription_id]/page.tsx +++ b/app/src/app/transcriptions/[transcription_id]/page.tsx @@ -1,14 +1,12 @@ -// transcriptions / [transcription_id] / page.tsx - import { validateRequest } from "@/auth"; import DetailedTranscription from "@/components/DetailedTranscription"; import NavigateBack from "@/components/NavigateBack"; import { db } from "@/db"; import { transcriptions } from "@/db/schema"; import { eq } from "drizzle-orm"; - import { Metadata } from "next"; -import { redirect } from "next/navigation"; +import { notFound } from "next/navigation"; +import { validate as validateUUID } from 'uuid'; export const metadata: Metadata = { title: "Lingo.ai | Transcription", @@ -23,6 +21,10 @@ interface PageProps { const page = async (props: PageProps) => { const { transcription_id } = props.params; + if (!validateUUID(transcription_id)) { + return notFound(); + } + // skip user signin validation for now const transcription = await db @@ -30,8 +32,12 @@ const page = async (props: PageProps) => { .from(transcriptions) .where(eq(transcriptions.id, transcription_id)); - return ( + if (transcription.length === 0) { + return notFound(); + } + + return (
{formatTime(recordingTime)}
- Enable mic access, record yourself, or upload an audio or video file -
+ <> ++ Enable mic access, record yourself, or upload an audio or video file +
++ Max file size: 5MB +
+ > )} )} diff --git a/app/src/components/TranscriptionItem.tsx b/app/src/components/TranscriptionItem.tsx index 1703a91..461ec96 100644 --- a/app/src/components/TranscriptionItem.tsx +++ b/app/src/components/TranscriptionItem.tsx @@ -27,7 +27,6 @@ const TranscriptionItem = (props: TranscriptionItemProps) => { const [defaultTranscriptionFilter, setDefaultTranscriptionFilter] = useState