Make scrobbling options mutually exclusive in offline settings

Immediate and Accumulated scrobbling cannot be enabled at the same
time, but both can be disabled. When one is turned on, the other
is automatically turned off.
This commit is contained in:
vicrodh committed 2026-01-16 10:07:05 -06:00
1 parent 8a5d3e8971
commit a68230fadc
1 file changed
+8
@@ -710,6 +710,10 @@
async function handleAllowImmediateScrobblingChange(enabled: boolean) {
try {
await setAllowImmediateScrobbling(enabled);
// Mutually exclusive: if turning on, turn off the other
if (enabled && offlineSettings.allowAccumulatedScrobbling) {
await setAllowAccumulatedScrobbling(false);
}
} catch (error) {
console.error('Failed to set allow immediate scrobbling:', error);
}
@@ -718,6 +722,10 @@
async function handleAllowAccumulatedScrobblingChange(enabled: boolean) {
try {
await setAllowAccumulatedScrobbling(enabled);
// Mutually exclusive: if turning on, turn off the other
if (enabled && offlineSettings.allowImmediateScrobbling) {
await setAllowImmediateScrobbling(false);
}
} catch (error) {
console.error('Failed to set allow accumulated scrobbling:', error);
}