diff --git a/Dockerfile b/Dockerfile index 84a4e869..5e76ff8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/bun.lockb b/bun.lockb index e40ffed9..acd41f55 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 5b74196e..bbd683e0 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" ], diff --git a/src/handler/voiceHandler.ts b/src/handler/voiceHandler.ts index 7478b67a..6bde6bbe 100644 --- a/src/handler/voiceHandler.ts +++ b/src/handler/voiceHandler.ts @@ -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"; @@ -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); diff --git a/src/service/cron.ts b/src/service/cron.ts index 5bb59105..b0dad661 100644 --- a/src/service/cron.ts +++ b/src/service/cron.ts @@ -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));