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
This commit is contained in:
wukko 2025-04-21 23:06:25 +06:00
parent 029934e580
commit ea8560e8a9
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,7 @@ const device = {
share: false, share: false,
directDownload: false, directDownload: false,
haptics: false, haptics: false,
defaultLocalProcessing: false,
}, },
userAgent: "sveltekit server", userAgent: "sveltekit server",
} }
@ -81,6 +82,8 @@ if (browser) {
// not sure if vibrations feel the same on android, // not sure if vibrations feel the same on android,
// so they're enabled only on ios 18+ for now // so they're enabled only on ios 18+ for now
haptics: modernIOS, haptics: modernIOS,
defaultLocalProcessing: !iOS && !device.browser.webkit,
}; };
device.userAgent = navigator.userAgent; device.userAgent = navigator.userAgent;

View File

@ -1,3 +1,4 @@
import { device } from "$lib/device";
import { defaultLocale } from "$lib/i18n/translations"; import { defaultLocale } from "$lib/i18n/translations";
import type { CobaltSettings } from "$lib/types/settings"; import type { CobaltSettings } from "$lib/types/settings";
@ -20,7 +21,7 @@ const defaultSettings: CobaltSettings = {
}, },
save: { save: {
alwaysProxy: false, alwaysProxy: false,
localProcessing: false, localProcessing: device.supports.defaultLocalProcessing || false,
audioBitrate: "128", audioBitrate: "128",
audioFormat: "mp3", audioFormat: "mp3",
disableMetadata: false, disableMetadata: false,