Skip to content

Commit e668ed4

Browse files
committed
Refactor error handling and optimize import list
1 parent fc22bc8 commit e668ed4

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

apps/media-server/src/__tests__/lib/ffmpeg.integration.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ describe("ffmpeg integration tests", () => {
2727
expect(audioData.length).toBeGreaterThan(0);
2828

2929
const hasId3Tag =
30-
audioData[0] === 0x49 &&
31-
audioData[1] === 0x44 &&
32-
audioData[2] === 0x33;
30+
audioData[0] === 0x49 && audioData[1] === 0x44 && audioData[2] === 0x33;
3331
const hasMpegSync =
3432
audioData[0] === 0xff && (audioData[1] & 0xe0) === 0xe0;
3533
expect(hasId3Tag || hasMpegSync).toBe(true);

apps/web/lib/audio-extract.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export async function extractAudioFromUrl(
8888
});
8989
} else {
9090
fs.unlink(outputPath).catch(() => {});
91-
reject(new Error(`Audio extraction failed with code ${code}: ${stderr}`));
91+
reject(
92+
new Error(`Audio extraction failed with code ${code}: ${stderr}`),
93+
);
9294
}
9395
});
9496
});
@@ -131,7 +133,9 @@ export async function extractAudioToBuffer(videoUrl: string): Promise<Buffer> {
131133
if (code === 0) {
132134
resolve(Buffer.concat(chunks));
133135
} else {
134-
reject(new Error(`Audio extraction failed with code ${code}: ${stderr}`));
136+
reject(
137+
new Error(`Audio extraction failed with code ${code}: ${stderr}`),
138+
);
135139
}
136140
});
137141
});

apps/web/next.config.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,11 @@ const nextConfig = {
4141
optimizePackageImports: [
4242
"@cap/ui",
4343
"@cap/utils",
44-
"@cap/web-api-contract",
45-
"@cap/web-domain",
46-
"@cap/web-backend",
47-
"@cap/database",
4844
"lucide-react",
4945
"framer-motion",
5046
"motion",
5147
"@fortawesome/free-solid-svg-icons",
5248
"@fortawesome/free-brands-svg-icons",
53-
"effect",
54-
"@effect/platform",
55-
"@effect/rpc",
56-
"@effect/sql-mysql2",
5749
"@tanstack/react-query",
5850
"recharts",
5951
"@radix-ui/react-dialog",

0 commit comments

Comments
 (0)