Skip to main content

AppConfig

Struct AppConfig 

Source
pub struct AppConfig {
Show 50 fields pub server: Option<MusicServer>, pub servers: Vec<SavedServer>, pub active_source: Source, pub source_explicitly_set: bool, pub music_directory: Vec<PathBuf>, pub theme: String, pub device_id: String, pub discord_presence: Option<bool>, pub discord_presence_paused: Option<bool>, pub sort_order: SortOrder, pub artist_view_order: ArtistViewOrder, pub listen_counts: HashMap<String, u64>, pub musicbrainz_token: String, pub lastfm_api_key: String, pub lastfm_api_secret: String, pub lastfm_session_key: String, pub librefm_api_key: String, pub librefm_api_secret: String, pub librefm_session_key: String, pub language: String, pub reduce_animations: bool, pub tracing_enabled: bool, pub auto_check_updates: bool, pub minimize_to_tray: bool, pub show_source_toggle: bool, pub sidebar_order: Vec<String>, pub volume: f32, pub volume_scroll_step: f32, pub crossfade_seconds: u8, pub custom_themes: HashMap<String, CustomTheme>, pub back_behavior: BackBehavior, pub channel_mode: ChannelMode, pub equalizer: EqualizerSettings, pub ytdlp_output_dir: String, pub ytdlp_options: YtdlpOptions, pub ytdlp_history: Vec<YtdlpHistoryEntry>, pub titlebar_mode: TitlebarMode, pub offline_quality: OfflineQuality, pub offline_tracks: HashMap<String, String>, pub player_bar_position: PlayerBarPosition, pub ui_style: UiStyle, pub hero_height: u32, pub home_sections: Vec<HomeSection>, pub listen_now_style: ListenNowStyle, pub artist_photo_source: ArtistPhotoSource, pub auto_fetch_covers: bool, pub cover_fetch_strategy: FetchStrategy, pub radio_registries: Vec<RegistryEntry>, pub prefer_local_lyrics: bool, pub enable_musixmatch_lyrics: bool,
}

Fields§

§server: Option<MusicServer>§servers: Vec<SavedServer>§active_source: Source

Id of the active server (servers.id), or None for local. The DB-backed source of truth for “which server is active”; server/servers above are hydrated from the servers table around it. (server stays for now so the ~90 existing config.server readers keep working — they migrate to id-based resolution with the auth-gate work.) The active source: Local or Server(id). Single source of truth for “which source/server is active” — server/servers above are hydrated from the servers table around it.

§source_explicitly_set: bool§music_directory: Vec<PathBuf>§theme: String§device_id: String§discord_presence: Option<bool>§discord_presence_paused: Option<bool>§sort_order: SortOrder§artist_view_order: ArtistViewOrder§listen_counts: HashMap<String, u64>§musicbrainz_token: String§lastfm_api_key: String§lastfm_api_secret: String§lastfm_session_key: String§librefm_api_key: String§librefm_api_secret: String§librefm_session_key: String§language: String§reduce_animations: bool§tracing_enabled: bool

Opt-in chrome/Perfetto performance trace. Read at startup (the subscriber is built once), so a change needs a restart. Adds runtime overhead — surfaced with a warning in settings.

§auto_check_updates: bool§minimize_to_tray: bool

Desktop-only: when enabled, closing the window hides it to the system tray instead of quitting, so playback keeps running in the background.

§show_source_toggle: bool§sidebar_order: Vec<String>§volume: f32§volume_scroll_step: f32§crossfade_seconds: u8§custom_themes: HashMap<String, CustomTheme>§back_behavior: BackBehavior§channel_mode: ChannelMode§equalizer: EqualizerSettings§ytdlp_output_dir: String§ytdlp_options: YtdlpOptions§ytdlp_history: Vec<YtdlpHistoryEntry>§titlebar_mode: TitlebarMode§offline_quality: OfflineQuality§offline_tracks: HashMap<String, String>§player_bar_position: PlayerBarPosition§ui_style: UiStyle§hero_height: u32§home_sections: Vec<HomeSection>§listen_now_style: ListenNowStyle§artist_photo_source: ArtistPhotoSource§auto_fetch_covers: bool§cover_fetch_strategy: FetchStrategy§radio_registries: Vec<RegistryEntry>§prefer_local_lyrics: bool§enable_musixmatch_lyrics: bool

Implementations§

Source§

impl AppConfig

Source

pub fn playback(&self) -> PlaybackConfig

Source

pub fn ui(&self) -> UiConfig

Source

pub fn library(&self) -> LibraryConfig

Source

pub fn integrations(&self) -> IntegrationConfig

Source§

impl AppConfig

Source

pub fn migrate_home_sections(&mut self)

Source

pub fn migrate_servers(&mut self)

Source

pub fn add_saved_server(&mut self, entry: SavedServer)

Source

pub fn remove_saved_server(&mut self, id: &str)

Source

pub fn find_saved_server(&self, id: &str) -> Option<&SavedServer>

Source

pub fn migrate_sidebar_order(&mut self)

Source

pub fn migrate_registry_paths(&mut self)

Source§

impl AppConfig

Source

pub fn clear_active_server(&mut self)

Source

pub fn set_active_server_snapshot(&mut self, server: MusicServer)

Source

pub fn active_service(&self) -> Option<MusicService>

Source

pub fn uses_jellyfin_server(&self) -> bool

Source

pub fn server_toggle_target(&self) -> Option<Source>

The server to activate when toggling into server mode: the current server if already on one, else the first saved server. None ⇒ no servers, so the toggle is a no-op.

Trait Implementations§

Source§

impl Clone for AppConfig

Source§

fn clone(&self) -> AppConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AppConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AppConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AppConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.