feat: add output filename suffixes, CPU fallback for GPU packages, and fix e2e tests

- Add tool-specific suffix to output filenames so downloads don't overwrite originals (batch & single-tool routes)
- Skip deleting shared models when uninstalling a bundle that shares models with another installed bundle
- Auto-detect NVIDIA GPU and swap GPU-only pip packages (onnxruntime-gpu, paddlepaddle-gpu) for CPU equivalents
- Refactor docker-compose with YAML anchors and explicit cpu/gpu profiles
- Add libheif-plugin-x265 to Dockerfile
- Fix install-all queue logic to handle concurrent individual installs and clear stale errors
- Unify playwright docker config to use same test dir with API_URL env var
- Fix flaky e2e selectors, rename Strip Metadata → Remove Metadata, handle collage custom dropzone, improve fallback test image generation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ashim
2026-04-20 10:56:47 +08:00
co-authored by Claude Opus 4.6
parent 92c0579a49
commit 6edb92c242
17 changed files with 234 additions and 66 deletions
+10 -1
View File
@@ -8,6 +8,7 @@
* Returns a ZIP file containing all processed images.
*/
import { randomUUID } from "node:crypto";
import { extname } from "node:path";
import { getBundleForTool, TOOL_BUNDLE_MAP } from "@ashim/shared";
import archiver from "archiver";
import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
@@ -170,7 +171,15 @@ export async function registerBatchRoutes(app: FastifyInstance): Promise<void> {
}
const result = await toolConfig.process(processBuffer, settings, processFilename);
results[index] = { buffer: result.buffer, filename: result.filename };
// Add tool suffix so downloads don't overwrite originals
let outFilename = result.filename;
if (outFilename === processFilename) {
const ext = extname(processFilename);
const base = ext ? processFilename.slice(0, -ext.length) : processFilename;
outFilename = `${base}_${toolId}${ext}`;
}
results[index] = { buffer: result.buffer, filename: outFilename };
progress.completedFiles++;
updateJobProgress({ ...progress });