Merge branch 'develop' into KoffeinFlummi-keybindings
This commit is contained in:
@@ -72,16 +72,19 @@ impl Playlists {
|
|||||||
cache_path.to_str().unwrap()
|
cache_path.to_str().unwrap()
|
||||||
);
|
);
|
||||||
let parsed: Result<PlaylistStore, _> = serde_json::from_str(&contents);
|
let parsed: Result<PlaylistStore, _> = serde_json::from_str(&contents);
|
||||||
if let Ok(cache) = parsed {
|
match parsed {
|
||||||
debug!("playlist cache loaded ({} lists)", cache.playlists.len());
|
Ok(cache) => {
|
||||||
let mut store = self.store.write().expect("can't writelock playlist store");
|
debug!("playlist cache loaded ({} lists)", cache.playlists.len());
|
||||||
store.clear();
|
let mut store = self.store.write().expect("can't writelock playlist store");
|
||||||
store.extend(cache.playlists);
|
store.clear();
|
||||||
|
store.extend(cache.playlists);
|
||||||
|
|
||||||
// force refresh of UI (if visible)
|
// force refresh of UI (if visible)
|
||||||
self.ev.send(Event::ScreenChange("playlists".to_owned()));
|
self.ev.send(Event::ScreenChange("playlists".to_owned()));
|
||||||
} else {
|
},
|
||||||
error!("playlist cache corrupted?");
|
Err(e) => {
|
||||||
|
error!("can't parse playlist cache: {}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user