Global is default mode
This commit is contained in:
+1
-1
@@ -277,7 +277,7 @@ pub async fn run(
|
|||||||
library_network_refreshing: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
library_network_refreshing: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||||
library_network_cursors: Arc::new(std::sync::Mutex::new(std::collections::HashMap::new())),
|
library_network_cursors: Arc::new(std::sync::Mutex::new(std::collections::HashMap::new())),
|
||||||
library_network_done: Arc::new(std::sync::Mutex::new(std::collections::HashSet::new())),
|
library_network_done: Arc::new(std::sync::Mutex::new(std::collections::HashSet::new())),
|
||||||
library_network_mode: crate::config::settings::LibrarySourceMode::Local,
|
library_network_mode: state.global.filters.source_mode,
|
||||||
library_network_art_fetching: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
library_network_art_fetching: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||||
library_network_art_attempted: Arc::new(std::sync::Mutex::new(
|
library_network_art_attempted: Arc::new(std::sync::Mutex::new(
|
||||||
std::collections::HashSet::new(),
|
std::collections::HashSet::new(),
|
||||||
|
|||||||
@@ -158,25 +158,25 @@ fn source_mode_cycles_on_library_playlists_and_queue_tabs() {
|
|||||||
update(&mut state, Action::CycleSourceMode),
|
update(&mut state, Action::CycleSourceMode),
|
||||||
Some(Effect::SourceModeChanged)
|
Some(Effect::SourceModeChanged)
|
||||||
);
|
);
|
||||||
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::My);
|
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Local);
|
||||||
|
|
||||||
state.active_tab = Tab::Playlists;
|
state.active_tab = Tab::Playlists;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
update(&mut state, Action::CycleSourceMode),
|
update(&mut state, Action::CycleSourceMode),
|
||||||
Some(Effect::SourceModeChanged)
|
Some(Effect::SourceModeChanged)
|
||||||
);
|
);
|
||||||
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Global);
|
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::My);
|
||||||
|
|
||||||
state.active_tab = Tab::Queue;
|
state.active_tab = Tab::Queue;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
update(&mut state, Action::CycleSourceMode),
|
update(&mut state, Action::CycleSourceMode),
|
||||||
Some(Effect::SourceModeChanged)
|
Some(Effect::SourceModeChanged)
|
||||||
);
|
);
|
||||||
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Local);
|
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Global);
|
||||||
|
|
||||||
state.active_tab = Tab::Federation;
|
state.active_tab = Tab::Federation;
|
||||||
assert_eq!(update(&mut state, Action::CycleSourceMode), None);
|
assert_eq!(update(&mut state, Action::CycleSourceMode), None);
|
||||||
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Local);
|
assert_eq!(state.global.filters.source_mode, LibrarySourceMode::Global);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum LibrarySourceMode {
|
pub enum LibrarySourceMode {
|
||||||
#[default]
|
|
||||||
Local,
|
Local,
|
||||||
My,
|
My,
|
||||||
|
#[default]
|
||||||
Global,
|
Global,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,6 +128,6 @@ hide_featured_only = true
|
|||||||
|
|
||||||
assert_eq!(settings.volume, 100);
|
assert_eq!(settings.volume, 100);
|
||||||
assert!(settings.library.hide_featured_only);
|
assert!(settings.library.hide_featured_only);
|
||||||
assert_eq!(settings.library.source_mode, LibrarySourceMode::Local);
|
assert_eq!(settings.library.source_mode, LibrarySourceMode::Global);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user