Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

test: count gallery preview loads, not byte-range reads

velixiocaa3d54d5c4b
diff --git a/electron/tests/gallery-preview-fallback-smoke.mjs b/electron/tests/gallery-preview-fallback-smoke.mjs
index a042d96b4..2d9b5901d 100644
--- a/electron/tests/gallery-preview-fallback-smoke.mjs
+++ b/electron/tests/gallery-preview-fallback-smoke.mjs
@@ -34,8 +34,12 @@ await page.route('**/api/community/items?*', (route) =>
);
await page.route('**/api/community/items/feat_00_the_librarian/preview*', async (route) => {
const local = new URL(route.request().url()).searchParams.get('local') === 'true';
- if (local) fallback++;
- else canonical++;
+ // Count loads, not reads: a playing media element may fetch further byte ranges of the same
+ // clip (slower CI runners do), but every new load starts at byte 0.
+ if (!/^bytes=[1-9]/.test(route.request().headers().range ?? '')) {
+ if (local) fallback++;
+ else canonical++;
+ }
const audio =
local && !broken
? readFileSync(