Skip to content

Commit a4a63e1

Browse files
authored
Fix fetch transcript (#2085)
* always use full path
1 parent c2742e6 commit a4a63e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/transcripts/flagger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { createWriteStream, existsSync } from 'fs';
22
import { readFile } from 'fs/promises';
33
import { Readable } from 'stream';
44
import { finished } from 'stream/promises';
5+
import path from 'path';
56
import { FFmpeg } from '@ffmpeg.wasm/main';
67
import type { Show } from '@prisma/client';
78
import core from '@ffmpeg.wasm/core-mt';
8-
import { env } from '$env/dynamic/private';
99
import { logProgress } from './logProgress';
1010

1111
const flag_paths = ['./audio/wes-flagger.mp3', './audio/scott-flagger.mp3'];
@@ -81,7 +81,7 @@ export async function addFlaggerAudio(show: Show): Promise<Buffer> {
8181
for (const [i, flag_path] of flag_paths.entries()) {
8282
// eslint-disable-next-line @typescript-eslint/naming-convention
8383
const __dirname = new URL('.', import.meta.url).pathname;
84-
const flag_buffer = await readFile(env.VERCEL ? flag_path : `${__dirname}/${flag_path}`);
84+
const flag_buffer = await readFile(path.join(__dirname, flag_path));
8585
ffmpeg.fs.writeFile(`flagger-${base_name}-${i}.mp3`, flag_buffer);
8686
console.log(`wrote flagger-${base_name}-${i}.mp3 to ffmpeg memory`);
8787
}

0 commit comments

Comments
 (0)