Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,27 @@ enabled = false
# proxy = { url = "http://proxy:8080", username = "user", password = "pass" }

[sources.tidal]
enabled = false
enabled = true
country_code = "US"
quality = "LOSSLESS" # HI_RES_LOSSLESS | LOSSLESS | HIGH | LOW
quality = "LOSSLESS" # HI_RES_LOSSLESS | LOSSLESS | HIGH | LOW
playlist_load_limit = 50
album_load_limit = 50
artist_load_limit = 20
get_oauth_token = false
# refresh_token = "your-refresh-token" # required for playback
# refresh_token = "your-refresh-token" # required for direct playback
# proxy = { url = "http://proxy:8080", username = "user", password = "pass" }

# HiFi-RestAPI proxy (https://github.com/binimum/hifi-api)
# When enabled, all catalog lookups and playback are routed through the proxy
# instead of the direct Tidal API. OAuth / refresh_token are not required.
# Multiple URLs are supported; requests are distributed round-robin.
# Note: HI_RES_LOSSLESS returns a DASH manifest which is not supported ( it wasn't playable for me) —
# use LOSSLESS or lower for playback via HiFi.
[sources.tidal.hifi]
enabled = true
urls = ["http://localhost:8000"] # one or more HiFi-RestAPI base URLs
quality = "LOSSLESS" # HI_RES_LOSSLESS | LOSSLESS | HIGH | LOW

[sources.soundcloud]
enabled = true
search_limit = 10
Expand Down Expand Up @@ -290,4 +301,4 @@ spatial = true

[metrics.prometheus]
enabled = false
endpoint = "/metrics"
endpoint = "/metrics"
25 changes: 24 additions & 1 deletion src/config/sources/tidal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ use crate::config::sources::{
default_true,
};

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct TidalHifiConfig {
#[serde(default = "default_false")]
pub enabled: bool,
#[serde(default)]
pub urls: Vec<String>,
#[serde(default = "default_tidal_quality")]
pub quality: String,
}

impl Default for TidalHifiConfig {
fn default() -> Self {
Self {
enabled: false,
urls: Vec::new(),
quality: default_tidal_quality(),
}
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct TidalConfig {
#[serde(default = "default_true")]
Expand All @@ -24,6 +44,8 @@ pub struct TidalConfig {
#[serde(default = "default_limit_20")]
pub artist_load_limit: usize,
pub proxy: Option<HttpProxyConfig>,
#[serde(default)]
pub hifi: TidalHifiConfig,
}

impl Default for TidalConfig {
Expand All @@ -38,6 +60,7 @@ impl Default for TidalConfig {
album_load_limit: 50,
artist_load_limit: 20,
proxy: None,
hifi: TidalHifiConfig::default(),
}
}
}
}
Loading