Skip to content

Commit

Permalink
Move ffmpeg to container image
Browse files Browse the repository at this point in the history
  • Loading branch information
holzmaster committed Aug 30, 2024
1 parent 3438eb8 commit 6e1dd91
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ FROM oven/bun:alpine AS runtime-dependencies

FROM oven/bun:alpine
WORKDIR /app
# ffmpeg needed for get-audio-duration
RUN apk add --no-cache \
font-noto-emoji \
fontconfig \
ffmpeg \
font-liberation \
&& fc-cache -f -v

Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@ffprobe-installer/ffprobe": "^2.1.2",
"@types/bun": "^1.1.8",
"@types/jsdom": "^21.1.7",
"@types/minimist": "^1.2.5",
Expand All @@ -58,11 +57,6 @@
"typescript": "^5.6.0-dev.20240801"
},
"trustedDependencies": [
"@ffprobe-installer/ffprobe",
"@ffprobe-installer/linux-x64",
"@ffprobe-installer/linux-arm64",
"@ffprobe-installer/darwin-arm64",
"@ffprobe-installer/win32-x64",
"@biomejs/biome",
"lefthook"
],
Expand Down
5 changes: 1 addition & 4 deletions src/handler/voiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
VoiceConnectionStatus,
} from "@discordjs/voice";
import type { VoiceChannel } from "discord.js";
import * as ffprobe from "@ffprobe-installer/ffprobe";
import * as gad from "get-audio-duration";
import * as sentry from "@sentry/bun";

Expand Down Expand Up @@ -66,9 +65,7 @@ export async function connectAndPlaySaufen(context: BotContext, filename?: strin
const fileToPlay = filename ?? randomEntry(files);
const file = path.resolve(context.path.sounds, fileToPlay);
try {
await fs.chmod(ffprobe.path, 0o555);

const duration = (await gad.getAudioDurationInSeconds(file, ffprobe.path)) * 1000;
const duration = (await gad.getAudioDurationInSeconds(file)) * 1000;
await playSaufen(file, duration);
const connection = await connectToHauptwois(wois);
connection.subscribe(player);
Expand Down
2 changes: 1 addition & 1 deletion src/service/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function schedule(context: BotContext) {
cron("1 0 * * *", () => checkBirthdays(context));
cron("0 20 1-25 12 *", () => publishAocLeaderBoard(context));
cron("0 0 * * 0", () => rerollNicknames(context));
cron("54 0-23 * * FRI-SUN", () => connectAndPlaySaufen(context));
cron("58 0-23 * * FRI-SUN", () => connectAndPlaySaufen(context));
cron("* * * * *", () => reminderHandler(context));
cron("* * * * *", () => woisVoteScheduler(context));
cron("* * * * *", () => processBans(context));
Expand Down

0 comments on commit 6e1dd91

Please sign in to comment.