From b88254c79406eeb2e214d398784f18332fd09154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Le=20Calvar?= Date: Tue, 16 May 2023 22:48:57 +0200 Subject: [PATCH] fix error when quality was not present in preference store --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index ad1e8a4..b9b55dc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,7 +42,7 @@ export async function register(options :RegisterServerOptions) { // Get stored data from the database, default to constants if not found hardwareDecode = await options.storageManager.getData('hardware-decode') == "true" // ?? DEFAULT_HARDWARE_DECODE // not needed, since undefined == "true" -> false - quality = parseInt(await options.storageManager.getData('compression-level')) ?? DEFAULT_QUALITY + quality = parseInt(await options.storageManager.getData('compression-level')) || DEFAULT_QUALITY for (const [resolution, bitrate] of baseBitrates) { const key = `base-bitrate-${resolution}`