import { rename } from "node:fs/promises"; import { test, expect } from "@playwright/test"; import { channelStage, generateReport, resetData, resolvePath, } from "./helpers"; // `.part` files are yt-dlp's in-progress download placeholders. They should // NOT count as a complete audio download — otherwise the prefilter marks the // video as already done and re-running "Download videos" won't let yt-dlp // resume the partial. test("audio..part doesn't count as a complete audio file", async ({ page, }) => { await resetData("one-transcribe-channel-with-audio"); // Turn vidA's only audio file into a .part — should now look undownloaded. await rename( resolvePath( "test-transcripts/channels/test-transcribe/data/vidA/audio.m4a", ), resolvePath( "test-transcripts/channels/test-transcribe/data/vidA/audio.m4a.part", ), ); await generateReport(page, "test-transcribe"); await page.goto(channelStage("test-transcribe", "transcribe")); // The "Downloaded but not transcribed" list shows videos with audio on // disk but no transcript. With vidA's audio now hidden behind .part, only // vidB and vidC should be listed. const list = page.getByLabel("downloaded without transcript list"); await expect(list).toBeVisible(); await expect( list.getByLabel(/^downloaded without transcript vid[A-C]$/), ).toHaveCount(2); await expect( page.getByLabel("downloaded without transcript vidA"), ).toHaveCount(0); });