Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Merge fixes: Content Factory series pages get real 404s, and a series reads as one in where-used

Claudeb524c1ab899b
diff --git a/src/app/(studio)/content-factory/[id]/page.tsx b/src/app/(studio)/content-factory/[id]/page.tsx
index 93de4f3a..bae8eca4 100644
--- a/src/app/(studio)/content-factory/[id]/page.tsx
+++ b/src/app/(studio)/content-factory/[id]/page.tsx
@@ -1,13 +1,16 @@
import type { Metadata } from "next";
+import { notFound } from "next/navigation";
import { Suspense } from "react";
import { SeriesView } from "@/components/content-factory/series-view";
import { getModel } from "@/lib/catalog";
import { pickerData } from "@/lib/catalog/faceless";
+import { recordExists } from "@/server/records";
export const metadata: Metadata = { title: "Series" };
async function Series({ params }: { params: PageProps<"/content-factory/[id]">["params"] }) {
const { id } = await params;
+ if (!recordExists({ kind: "series", ids: [id] })) notFound();
return <SeriesView id={id} voices={pickerData(getModel).voices} />;
}
diff --git a/src/lib/library.ts b/src/lib/library.ts
index ad46b555..1725e339 100644
--- a/src/lib/library.ts
+++ b/src/lib/library.ts
@@ -301,7 +301,7 @@ export interface AssetUse {
trashed?: boolean;
}
-const plural = (what: string) => (/(s|x|ch|sh)$/.test(what) ? `${what}es` : `${what}s`);
+const plural = (what: string) => (/series$/.test(what) ? what : /(s|x|ch|sh)$/.test(what) ? `${what}es` : `${what}s`);
/** "2 results (1 in the Trash), the element “Maya” and 3 canvases": where a file is used, in one line. */
export function describeUses(uses: AssetUse[]): string {
diff --git a/src/lib/record-pages.ts b/src/lib/record-pages.ts
index 155916fb..ec33d506 100644
--- a/src/lib/record-pages.ts
+++ b/src/lib/record-pages.ts
@@ -8,7 +8,7 @@
*/
import { HUB_MODES, type HubKind } from "./hubs";
-export type RecordKind = "cinema" | "canvas" | "assist-project" | "layers" | "shorts" | "brand" | "element" | "channel" | "episode" | "explainer";
+export type RecordKind = "cinema" | "canvas" | "assist-project" | "layers" | "shorts" | "brand" | "element" | "channel" | "episode" | "explainer" | "series";
/** A record a page needs, with its ids in the order the lookup takes them. */
export interface RecordRef {
@@ -31,6 +31,7 @@ const PAGES: [RegExp, (m: string[]) => RecordRef][] = [
[new RegExp(`^/faceless/${SEG}/${SEG}$`), ([id, episode]) => ({ kind: "episode", ids: [id, episode] })],
[new RegExp(`^/faceless/${SEG}$`), ([id]) => ({ kind: "channel", ids: [id] })],
[new RegExp(`^/explainer/${SEG}$`), ([id]) => ({ kind: "explainer", ids: [id] })],
+ [new RegExp(`^/content-factory/${SEG}$`), ([id]) => ({ kind: "series", ids: [id] })],
];
/** Static pages that a record pattern would also match (/ads/multiplier is not a brand). */
diff --git a/src/server/records.ts b/src/server/records.ts
index 187ee8e2..e5069846 100644
--- a/src/server/records.ts
+++ b/src/server/records.ts
@@ -14,6 +14,7 @@ const LOOKUPS: Record<RecordRef["kind"], string> = {
channel: "SELECT 1 FROM faceless_channels WHERE id = ?",
episode: "SELECT 1 FROM faceless_episodes WHERE channel_id = ? AND id = ?",
explainer: "SELECT 1 FROM faceless_episodes WHERE id = ?",
+ series: "SELECT 1 FROM content_series WHERE id = ?",
};
/**
diff --git a/tests/record-pages.test.ts b/tests/record-pages.test.ts
index 226fe7ec..a1b90e55 100644
--- a/tests/record-pages.test.ts
+++ b/tests/record-pages.test.ts
@@ -32,10 +32,11 @@ describe("record pages (real 404s)", () => {
expect(recordForPath("/faceless/c1/new")).toEqual({ kind: "channel", ids: ["c1"] });
expect(recordForPath("/faceless/c1/ep1")).toEqual({ kind: "episode", ids: ["c1", "ep1"] });
expect(recordForPath("/explainer/x1")).toEqual({ kind: "explainer", ids: ["x1"] });
+ expect(recordForPath("/content-factory/s1")).toEqual({ kind: "series", ids: ["s1"] });
});
it("leaves list pages and fixed sub-pages alone", () => {
- for (const p of ["/", "/cinema", "/canvas/", "/ads", "/ads/multiplier", "/assist/projects", "/assist/skills", "/faceless", "/explainer", "/library", "/apps/app-face-swap", "/cinema/a/b"]) {
+ for (const p of ["/", "/cinema", "/canvas/", "/ads", "/ads/multiplier", "/assist/projects", "/assist/skills", "/faceless", "/explainer", "/content-factory", "/library", "/apps/app-face-swap", "/cinema/a/b"]) {
expect(recordForPath(p), p).toBeNull();
}
});