refactor: move and add functions

This commit is contained in:
Thomas Frans
2023-05-27 19:08:45 +02:00
committed by Henrik Friedrichsen
parent 04cbe8ac20
commit c36d3cf272
9 changed files with 183 additions and 133 deletions

View File

@@ -42,7 +42,7 @@ pub struct Library {
}
impl Library {
pub fn new(ev: &EventManager, spotify: Spotify, cfg: Arc<Config>) -> Self {
pub fn new(ev: EventManager, spotify: Spotify, cfg: Arc<Config>) -> Self {
let current_user = spotify.api.current_user();
let user_id = current_user.as_ref().map(|u| u.id.id().to_string());
let display_name = current_user.as_ref().and_then(|u| u.display_name.clone());
@@ -56,7 +56,7 @@ impl Library {
is_done: Arc::new(RwLock::new(false)),
user_id,
display_name,
ev: ev.clone(),
ev,
spotify,
cfg,
};