From b1d3b77edbf19f89a99e438c6fb9947b62c74ae7 Mon Sep 17 00:00:00 2001 From: Sebastjan Date: Tue, 9 Jun 2026 00:09:06 +0200 Subject: [PATCH] BunnyService: don't crash if config missing + HybridStorage reads from DB --- server/bunny.ts | 8 +++++++- server/storage.ts | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/server/bunny.ts b/server/bunny.ts index 8182e79..90a5749 100644 --- a/server/bunny.ts +++ b/server/bunny.ts @@ -51,6 +51,7 @@ interface BunnyLibraryResponse { } export class BunnyService { + disabled: boolean = false; private migratedGuids: Set = new Set(); private migratedGuidsRefreshedAt: number = 0; @@ -100,7 +101,12 @@ export class BunnyService { this.hostname = process.env.BUNNY_HOSTNAME!; if (!this.apiKey || !this.libraryId || !this.hostname) { - throw new Error("Missing Bunny.net configuration"); + console.warn("⚠️ Missing Bunny.net configuration — BunnyService running in disabled mode (uses DB-only)"); + this.disabled = true; + this.apiKey = ""; + this.libraryId = ""; + this.cdnHostname = ""; + return; } } diff --git a/server/storage.ts b/server/storage.ts index a650a08..991153f 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1016,11 +1016,11 @@ export class HybridStorage implements IStorage { // Video operations - use Bunny.net async getVideos(limit?: number, offset?: number, search?: string): Promise { - return this.bunnyStorage.getVideos(limit, offset, search); + return this.databaseStorage.getVideos(limit, offset, search); } async getVideo(id: string): Promise