Skip to content

Commit

Permalink
#311: parse track=null
Browse files Browse the repository at this point in the history
  • Loading branch information
xou816 committed Sep 22, 2021
1 parent 2a591fe commit e47869f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/api_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl WithImages for Playlist {
#[derive(Deserialize, Debug, Clone)]
pub struct PlaylistTrack {
pub is_local: bool,
pub track: FailibleTrackItem,
pub track: Option<FailibleTrackItem>,
}

#[derive(Deserialize, Debug, Clone)]
Expand Down Expand Up @@ -260,7 +260,7 @@ impl From<Page<PlaylistTrack>> for Vec<SongDescription> {
fn from(page: Page<PlaylistTrack>) -> Self {
let items = page
.into_iter()
.filter_map(|PlaylistTrack { is_local, track }| track.get().filter(|_| !is_local))
.filter_map(|PlaylistTrack { is_local, track }| track?.get().filter(|_| !is_local))
.collect::<Vec<TrackItem>>();
Page::new(items).into()
}
Expand Down

0 comments on commit e47869f

Please sign in to comment.