From ea8560e8a9ea66658756e8d8c7aeaf496024111a Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 21 Apr 2025 23:06:25 +0600 Subject: [PATCH] web/settings/defaults: toggle localProcessing depending on device webkit is really weird with wasm ram management, so we disable local processing by default there. the user can still enable it manually in settings, but then we're not at fault by allowing potentially broken behavior by default --- web/src/lib/device.ts | 3 +++ web/src/lib/settings/defaults.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/lib/device.ts b/web/src/lib/device.ts index ca52712d..37929d11 100644 --- a/web/src/lib/device.ts +++ b/web/src/lib/device.ts @@ -27,6 +27,7 @@ const device = { share: false, directDownload: false, haptics: false, + defaultLocalProcessing: false, }, userAgent: "sveltekit server", } @@ -81,6 +82,8 @@ if (browser) { // not sure if vibrations feel the same on android, // so they're enabled only on ios 18+ for now haptics: modernIOS, + + defaultLocalProcessing: !iOS && !device.browser.webkit, }; device.userAgent = navigator.userAgent; diff --git a/web/src/lib/settings/defaults.ts b/web/src/lib/settings/defaults.ts index 8e4e8073..a7818c5d 100644 --- a/web/src/lib/settings/defaults.ts +++ b/web/src/lib/settings/defaults.ts @@ -1,3 +1,4 @@ +import { device } from "$lib/device"; import { defaultLocale } from "$lib/i18n/translations"; import type { CobaltSettings } from "$lib/types/settings"; @@ -20,7 +21,7 @@ const defaultSettings: CobaltSettings = { }, save: { alwaysProxy: false, - localProcessing: false, + localProcessing: device.supports.defaultLocalProcessing || false, audioBitrate: "128", audioFormat: "mp3", disableMetadata: false,