fix: handle empty artists
This commit is contained in:
parent
f98c85b385
commit
3574a44b77
2 changed files with 10 additions and 9 deletions
|
|
@ -191,14 +191,15 @@ fn map_artist_page(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut content = res.contents.single_column_browse_results_renderer.contents;
|
let sections = res
|
||||||
let sections = content
|
.contents
|
||||||
.try_swap_remove(0)
|
.single_column_browse_results_renderer
|
||||||
.ok_or(ExtractionError::InvalidData(Cow::Borrowed("no content")))?
|
.contents
|
||||||
.tab_renderer
|
.into_iter()
|
||||||
.content
|
.next()
|
||||||
.section_list_renderer
|
.and_then(|tab| tab.tab_renderer.content)
|
||||||
.contents;
|
.map(|c| c.section_list_renderer.contents)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
let mut mapper = MusicListMapper::with_artist(
|
let mut mapper = MusicListMapper::with_artist(
|
||||||
lang,
|
lang,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use super::{
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub(crate) struct MusicArtist {
|
pub(crate) struct MusicArtist {
|
||||||
pub contents: SingleColumnBrowseResult<Tab<SectionList<ItemSection>>>,
|
pub contents: SingleColumnBrowseResult<Tab<Option<SectionList<ItemSection>>>>,
|
||||||
pub header: Header,
|
pub header: Header,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue