= memo(
{videoDuration && (
- {formatDuration(videoDuration.toString())}
+ {formatDuration(videoDuration)}
)}
{imageUrl.data && (
diff --git a/apps/web/components/tools/types.ts b/apps/web/components/tools/types.ts
index 6ddf48db2b..c8ca7dbbbf 100644
--- a/apps/web/components/tools/types.ts
+++ b/apps/web/components/tools/types.ts
@@ -1,11 +1,11 @@
export interface ToolPageContent {
- slug: string;
+ slug?: string;
title: string;
description: string;
- publishedAt: string;
- category: string;
- author: string;
- tags: string[];
+ publishedAt?: string;
+ category?: string;
+ author?: string;
+ tags?: string[];
cta: {
title: string;
diff --git a/apps/web/lib/effect-react-query.ts b/apps/web/lib/effect-react-query.ts
index 9c47937840..f9d0d651fd 100644
--- a/apps/web/lib/effect-react-query.ts
+++ b/apps/web/lib/effect-react-query.ts
@@ -246,7 +246,7 @@ export function makeUseEffectMutation(
const runtime = useEffectRuntime();
const baseResults = useMutation({
- ...options,
+ ...(options as any),
mutationFn:
typeof mutationFn === "function"
? async (variables: TVariables) => {
diff --git a/apps/web/lib/folder.ts b/apps/web/lib/folder.ts
index 907a8daea2..ce55abdd93 100644
--- a/apps/web/lib/folder.ts
+++ b/apps/web/lib/folder.ts
@@ -113,10 +113,9 @@ async function getSharedSpacesForVideos(videoIds: string[]) {
// Add space-level sharing
spaceSharing.forEach((space) => {
- if (!sharedSpacesMap[space.videoId]) {
- sharedSpacesMap[space.videoId] = [];
- }
- sharedSpacesMap[space.videoId].push({
+ const spaces = sharedSpacesMap[space.videoId] ?? [];
+ sharedSpacesMap[space.videoId] = spaces;
+ spaces.push({
id: space.id,
name: space.name,
organizationId: space.organizationId,
@@ -127,10 +126,10 @@ async function getSharedSpacesForVideos(videoIds: string[]) {
// Add organization-level sharing
orgSharing.forEach((org) => {
- if (!sharedSpacesMap[org.videoId]) {
- sharedSpacesMap[org.videoId] = [];
- }
- sharedSpacesMap[org.videoId].push({
+ const spaces = sharedSpacesMap[org.videoId] ?? [];
+ sharedSpacesMap[org.videoId] = spaces;
+
+ spaces.push({
id: org.id,
name: org.name,
organizationId: org.organizationId,
diff --git a/apps/web/scripts/reset-ai-processing-flags.ts b/apps/web/scripts/reset-ai-processing-flags.ts
index a550d04772..b3ec488366 100644
--- a/apps/web/scripts/reset-ai-processing-flags.ts
+++ b/apps/web/scripts/reset-ai-processing-flags.ts
@@ -12,7 +12,7 @@ async function resetStuckAiProcessingFlags() {
.select()
.from(videos)
.where(sql`
- (metadata->>'aiProcessing')::boolean = true
+ (metadata->>'aiProcessing')::boolean = true
AND updated_at < ${tenMinutesAgo}
`);
@@ -32,7 +32,7 @@ async function resetStuckAiProcessingFlags() {
metadata: {
...metadata,
aiProcessing: false,
- generationError: "AI processing was stuck and has been reset",
+ // generationError: "AI processing was stuck and has been reset",
},
})
.where(sql`id = ${video.id}`);
diff --git a/apps/web/utils/changelog.ts b/apps/web/utils/changelog.ts
index 781fe20e65..1527f1f305 100644
--- a/apps/web/utils/changelog.ts
+++ b/apps/web/utils/changelog.ts
@@ -14,11 +14,12 @@ function parseFrontmatter(fileContent: string) {
const match = frontmatterRegex.exec(fileContent);
const frontMatterBlock = match![1];
const content = fileContent.replace(frontmatterRegex, "").trim();
- const frontMatterLines = frontMatterBlock.trim().split("\n");
+ const frontMatterLines = frontMatterBlock!.trim().split("\n");
const metadata: Partial = {};
frontMatterLines.forEach((line) => {
const [key, ...valueArr] = line.split(": ");
+ if (!key) return;
let value = valueArr.join(": ").trim();
value = value.replace(/^['"](.*)['"]$/, "$1"); // Remove quotes
metadata[key.trim() as keyof ChangelogMetadata] = value;
diff --git a/packages/database/schema.ts b/packages/database/schema.ts
index db44f12312..21afc96f28 100644
--- a/packages/database/schema.ts
+++ b/packages/database/schema.ts
@@ -1,4 +1,4 @@
-import type { Folder } from "@cap/web-domain";
+import type { Folder, Video } from "@cap/web-domain";
import {
boolean,
customType,
@@ -231,7 +231,7 @@ export const folders = mysqlTable(
export const videos = mysqlTable(
"videos",
{
- id: nanoId("id").notNull().primaryKey().unique(),
+ id: nanoId("id").notNull().primaryKey().unique().$type(),
ownerId: nanoId("ownerId").notNull(),
name: varchar("name", { length: 255 }).notNull().default("My Video"),
bucket: nanoIdNullable("bucket"),
diff --git a/packages/ui/src/components/Dropdown.tsx b/packages/ui/src/components/Dropdown.tsx
index 290a5c6f6a..b764298b0d 100644
--- a/packages/ui/src/components/Dropdown.tsx
+++ b/packages/ui/src/components/Dropdown.tsx
@@ -57,9 +57,13 @@ DropdownMenuSubContent.displayName =
const DropdownMenuContent = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, sideOffset = 4, ...props }, ref) => (
-
+ React.ComponentPropsWithoutRef & {
+ container?: React.ComponentPropsWithoutRef<
+ typeof DropdownMenuPrimitive.Portal
+ >["container"];
+ }
+>(({ className, sideOffset = 4, container, ...props }, ref) => (
+