Skip to content

Open source CapCut alternative.

TypeScript

refactor(cut): drop the dead per-project export-jobs endpoint [rebuild]

David Leff428d067de6
diff --git a/site/src/cut/server/http/export.ts b/site/src/cut/server/http/export.ts
index 72a4dc48..63b695c2 100644
--- a/site/src/cut/server/http/export.ts
+++ b/site/src/cut/server/http/export.ts
@@ -1,14 +1,8 @@
-import { cancelJob, createJob, getJob, listAllJobs, listJobsForProject } from "../jobs";
+import { cancelJob, createJob, getJob, listAllJobs } from "../jobs";
import { serveFileRange } from "../serveFile";
/** Export rendering: start a job, poll it, cancel it, download the result. */
export const exportApi = {
- /** Export jobs (running or recently settled) for a project, so a reopened or
- * reloaded editor can reconnect to a render still in flight. */
- activeForProject(_req: Request, { id }: { id: string }) {
- return Response.json(listJobsForProject(id));
- },
-
/** Every export job across every project, in start order — the feed the
* app-wide exports dock polls so it shows the same queue in every tab. */
activeAll() {
diff --git a/site/src/cut/server/http/routes.ts b/site/src/cut/server/http/routes.ts
index 56c46cda..b216752e 100644
--- a/site/src/cut/server/http/routes.ts
+++ b/site/src/cut/server/http/routes.ts
@@ -52,7 +52,6 @@ export const CUT_ROUTES: CutRoute[] = [
{ method: "POST", path: "/api/cut/projects/:id/audio", handler: (req, p) => projectsApi.audio(req, { id: p.id }) },
{ method: "POST", path: "/api/cut/projects/:id/duplicate", handler: (req, p) => projectsApi.duplicate(req, { id: p.id }) },
{ method: "GET", path: "/api/cut/projects/:id/preview", handler: (req, p) => projectsApi.servePreview(req, { id: p.id }) },
- { method: "GET", path: "/api/cut/projects/:id/export-jobs", handler: (req, p) => exportApi.activeForProject(req, { id: p.id }) },
{ method: "GET", path: "/api/cut/library", handler: () => libraryApi.list() },
{ method: "POST", path: "/api/cut/library", handler: (req) => libraryApi.upload(req) },
diff --git a/site/src/cut/server/jobs.ts b/site/src/cut/server/jobs.ts
index 378d456c..fcd0ebc8 100644
--- a/site/src/cut/server/jobs.ts
+++ b/site/src/cut/server/jobs.ts
@@ -183,13 +183,6 @@ function jobView(j: Job) {
};
}
-/** Export jobs (queued, running, or recently settled) for one project. */
-export function listJobsForProject(projectId: string) {
- return [...jobs.values()]
- .filter((j) => j.projectId === projectId && j.target !== "preview")
- .map(jobView);
-}
-
/** Every export job for the requesting account, across all its projects — the
* source of truth the app-wide exports dock reflects, so it shows the same set
* in every tab. Scoped to the account so a shared Mac never crosses feeds. */