fix error when quality was not present in preference store

This commit is contained in:
Théo Le Calvar 2023-05-16 22:48:57 +02:00
parent 8c3f87ae86
commit b88254c794

View File

@ -42,7 +42,7 @@ export async function register(options :RegisterServerOptions) {
// Get stored data from the database, default to constants if not found // 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 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) { for (const [resolution, bitrate] of baseBitrates) {
const key = `base-bitrate-${resolution}` const key = `base-bitrate-${resolution}`