fix: ignore live tracks in YTM searches
This commit is contained in:
parent
69d64e5aca
commit
f3f2e1d3ca
4 changed files with 11839 additions and 0 deletions
|
|
@ -169,6 +169,9 @@ pub(crate) struct ListMusicItem {
|
|||
#[serde_as(as = "Option<Text>")]
|
||||
pub index: Option<String>,
|
||||
pub menu: Option<MusicItemMenu>,
|
||||
#[serde(default)]
|
||||
#[serde_as(deserialize_as = "VecSkipError<_>")]
|
||||
pub badges: Vec<TrackBadge>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Copy, Clone, Deserialize)]
|
||||
|
|
@ -419,6 +422,12 @@ pub(crate) struct SimpleHeaderRenderer {
|
|||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) enum TrackBadge {
|
||||
LiveBadgeRenderer {},
|
||||
}
|
||||
|
||||
/*
|
||||
#MAPPER
|
||||
*/
|
||||
|
|
@ -588,6 +597,15 @@ impl MusicListMapper {
|
|||
view_count: Option<TextComponents>,
|
||||
}
|
||||
|
||||
// Dont map music livestreams
|
||||
if item
|
||||
.badges
|
||||
.iter()
|
||||
.any(|b| matches!(b, TrackBadge::LiveBadgeRenderer {}))
|
||||
{
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let p = match item.flex_column_display_style {
|
||||
// Search result
|
||||
FlexColumnDisplayStyle::TwoLines => {
|
||||
|
|
|
|||
Reference in a new issue