import { test, expect } from "@playwright/test"; import { resetData, writeSettings } from "./helpers"; // A pre-multi-app settings.json (transcribeBin/transcribeArgs/transcribeModel, // no transcriptionApp/workers keys) must migrate onto the worker model when // read, so the Workers page shows a worker on the matching engine rather than // crashing on missing fields. test("legacy whisper settings migrate onto a whisper-cpp worker", async ({ page, }) => { await resetData(null); await writeSettings({ adminTitle: "Test Admin", maxTranscriptPageBytes: 8388608, sleepBetweenDownloadsSeconds: 0, transcribeBin: "whisper-cli", transcribeModel: "/models/ggml.bin", transcribeArgs: ["-ojf", "-l", "en", "-m", "{model}", "-of", "{outputBase}", "{audioFile}"], }); await page.goto("/workers"); await expect(page.getByLabel("worker 1 engine")).toHaveValue("whisper-cpp"); }); test("legacy settings whose binary is chough migrate onto a chough worker", async ({ page, }) => { await resetData(null); await writeSettings({ adminTitle: "Test Admin", maxTranscriptPageBytes: 8388608, sleepBetweenDownloadsSeconds: 0, transcribeBin: "chough", transcribeModel: "", transcribeArgs: ["-f", "json", "-o", "{outputBase}", "{audioFile}"], }); await page.goto("/workers"); await expect(page.getByLabel("worker 1 engine")).toHaveValue("chough"); });