Change playback defaults: gapless off, context icon off, stream uncached off

Aligns defaults with intended new-install and reset behavior:
- gapless_enabled: false (was true)
- show_context_icon: false (was true)
- stream_first_track: false (was true)
Updates DB migration defaults and frontend reset handler to match.
This commit is contained in:
vicrodh committed 2026-02-08 14:13:06 -06:00
1 parent bf370e5373
commit 681d3e5dac
3 files changed
+10 -10

No files matched your search

+4 -4
View File
@@ -51,14 +51,14 @@ impl Default for AudioSettings {
backend_type: None, // Auto-detect (PipeWire if available, else ALSA)
alsa_plugin: Some(AlsaPlugin::Hw), // Default to hw (bit-perfect)
alsa_hardware_volume: false, // Disabled by default (maximum compatibility)
stream_first_track: true, // Enabled by default for faster playback start
stream_first_track: false, // Disabled by default — user opts in
stream_buffer_seconds: 3, // 3 seconds initial buffer
streaming_only: false, // Disabled by default (cache tracks for instant replay)
limit_quality_to_device: false, // Disabled in 1.1.9 — detection logic unreliable (#45)
device_max_sample_rate: None, // Set when device is selected
normalization_enabled: false, // Off by default — preserves bit-perfect pipeline
normalization_target_lufs: -14.0, // Spotify/YouTube standard
gapless_enabled: true, // On by default — seamless track transitions
gapless_enabled: false, // Off by default — user opts in
}
}
}
@@ -104,7 +104,7 @@ impl AudioSettingsStore {
let _ = conn.execute("ALTER TABLE audio_settings ADD COLUMN device_max_sample_rate INTEGER", []);
let _ = conn.execute("ALTER TABLE audio_settings ADD COLUMN normalization_enabled INTEGER DEFAULT 0", []);
let _ = conn.execute("ALTER TABLE audio_settings ADD COLUMN normalization_target_lufs REAL DEFAULT -14.0", []);
let _ = conn.execute("ALTER TABLE audio_settings ADD COLUMN gapless_enabled INTEGER DEFAULT 1", []);
let _ = conn.execute("ALTER TABLE audio_settings ADD COLUMN gapless_enabled INTEGER DEFAULT 0", []);
Ok(Self { conn })
}
@@ -151,7 +151,7 @@ impl AudioSettingsStore {
device_max_sample_rate: row.get::<_, Option<i64>>(11)?.map(|r| r as u32),
normalization_enabled: row.get::<_, Option<i64>>(12)?.unwrap_or(0) != 0,
normalization_target_lufs: row.get::<_, Option<f64>>(13)?.unwrap_or(-14.0) as f32,
gapless_enabled: row.get::<_, Option<i64>>(14)?.unwrap_or(1) != 0,
gapless_enabled: row.get::<_, Option<i64>>(14)?.unwrap_or(0) != 0,
})
},
)
+3 -3
View File
@@ -55,7 +55,7 @@ impl Default for PlaybackPreferences {
fn default() -> Self {
Self {
autoplay_mode: AutoplayMode::ContinueWithinSource,
show_context_icon: true,
show_context_icon: false,
}
}
}
@@ -99,7 +99,7 @@ impl PlaybackPreferencesStore {
if !column_exists {
info!("[PlaybackPrefs] Migrating: adding show_context_icon column");
conn.execute(
"ALTER TABLE playback_preferences ADD COLUMN show_context_icon INTEGER NOT NULL DEFAULT 1",
"ALTER TABLE playback_preferences ADD COLUMN show_context_icon INTEGER NOT NULL DEFAULT 0",
[]
).map_err(|e| format!("Failed to add show_context_icon column: {}", e))?;
info!("[PlaybackPrefs] Migration successful");
@@ -108,7 +108,7 @@ impl PlaybackPreferencesStore {
// Step 4: Insert default row if it doesn't exist
conn.execute(
"INSERT OR IGNORE INTO playback_preferences (id, autoplay_mode, show_context_icon)
VALUES (1, 'continue', 1)",
VALUES (1, 'continue', 0)",
[]
).map_err(|e| format!("Failed to insert default preferences: {}", e))?;