From 9bc98f70fd52c5dc73c5ddc6e1552656919de98b Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Thu, 7 Jan 2021 17:55:43 +0100 Subject: [PATCH] Expose gapless playback config option --- README.md | 1 + src/config.rs | 1 + src/spotify.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bb91f4..8ff01ad 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,7 @@ Possible configuration values are: * `notify`: Enable or disable desktop notifications, off by default * `bitrate`: The audio bitrate to use for streaming, can be 96, 160, or 320 (default is 320) * `album_column`: Show album column for tracks, on by default +* `gapless`: Allows gapless playback (default is false) Keybindings can be configured in `[keybindings]` section in `config.toml`, e.g. as such: diff --git a/src/config.rs b/src/config.rs index 82bcbee..6ff5776 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,7 @@ pub struct ConfigValues { pub notify: Option, pub bitrate: Option, pub album_column: Option, + pub gapless: Option, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] diff --git a/src/spotify.rs b/src/spotify.rs index e428c65..d7becd7 100644 --- a/src/spotify.rs +++ b/src/spotify.rs @@ -421,7 +421,7 @@ impl Spotify { } let player_config = PlayerConfig { - gapless: false, + gapless: cfg.values().gapless.unwrap_or(false), bitrate: bitrate.unwrap_or(Bitrate::Bitrate320), normalisation: cfg.values().volnorm.unwrap_or(false), normalisation_pregain: cfg.values().volnorm_pregain.unwrap_or(0.0),