Lazy-load non-library playlists

Fix #62
This commit is contained in:
KoffeinFlummi
2019-04-28 11:31:32 +02:00
parent 82dee638c5
commit 662b718a4c
4 changed files with 92 additions and 60 deletions

View File

@@ -224,8 +224,8 @@ impl SearchView {
_offset: usize,
_append: bool,
) -> u32 {
if let Some(results) = spotify.playlist(&query) {
let pls = vec![Playlist::from_full_playlist(&results, &&spotify)];
if let Some(result) = spotify.playlist(&query).as_ref() {
let pls = vec![result.into()];
let mut r = playlists.write().unwrap();
*r = pls;
return 1;
@@ -245,7 +245,7 @@ impl SearchView {
.playlists
.items
.iter()
.map(|sp| Playlist::from_simplified_playlist(sp, &&spotify))
.map(|sp| sp.into())
.collect();
let mut r = playlists.write().unwrap();