File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import { createWriteStream, existsSync } from 'fs';
22import { readFile } from 'fs/promises' ;
33import { Readable } from 'stream' ;
44import { finished } from 'stream/promises' ;
5+ import path from 'path' ;
56import { FFmpeg } from '@ffmpeg.wasm/main' ;
67import type { Show } from '@prisma/client' ;
78import core from '@ffmpeg.wasm/core-mt' ;
8- import { env } from '$env/dynamic/private' ;
99import { logProgress } from './logProgress' ;
1010
1111const 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 }
You can’t perform that action at this time.
0 commit comments