fix: update audio file naming in ZIP export to use original file names
This commit is contained in:
@@ -65,9 +65,7 @@ export async function POST(request: NextRequest) {
|
|||||||
|
|
||||||
if (existsSync(audioPath)) {
|
if (existsSync(audioPath)) {
|
||||||
const fileBuffer = await readFileAsync(audioPath);
|
const fileBuffer = await readFileAsync(audioPath);
|
||||||
// Use the original fileName from CSV, removing 'wavs_' prefix if present
|
zip.file(entry.fileName, fileBuffer);
|
||||||
const cleanFileName = entry.fileName.replace(/^wavs_/, '');
|
|
||||||
audioFolder.file(cleanFileName, fileBuffer);
|
|
||||||
filesAdded++;
|
filesAdded++;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`Audio file not found: ${audioPath}`);
|
console.warn(`Audio file not found: ${audioPath}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user