Compare commits

..

No commits in common. "ca1338b6b7803b0d0efc59de65e4ed39341e66fb" and "d0a8b6fabe9c262a89f162076712bb794a105cd3" have entirely different histories.

10 changed files with 2027 additions and 250 deletions

View file

@ -49,7 +49,6 @@ use crate::{
/// slightly different features /// slightly different features
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum ClientType { pub enum ClientType {
/// Client used by youtube.com /// Client used by youtube.com
Desktop, Desktop,

View file

@ -272,18 +272,12 @@ fn map_artist_page(
let mapped = mapper.group_items(); let mapped = mapper.group_items();
static WIKIPEDIA_REGEX: Lazy<Regex> = static WIKIPEDIA_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"\(?https://[a-z\d-]+\.wikipedia.org/wiki/[^\s]+").unwrap()); Lazy::new(|| Regex::new(r"https://[a-z]+\.wikipedia.org/wiki/[^()\s]+").unwrap());
let wikipedia_url = header.description.as_deref().and_then(|h| { let wikipedia_url = header.description.as_deref().and_then(|h| {
WIKIPEDIA_REGEX.captures(h).and_then(|c| c.get(0)).map(|m| { WIKIPEDIA_REGEX
let m = m.as_str(); .captures(h)
match m.strip_prefix('(') { .and_then(|c| c.get(0))
Some(m) => match m.strip_suffix(')') { .map(|m| m.as_str().to_owned())
Some(m) => m.to_owned(),
None => m.to_owned(),
},
None => m.to_owned(),
}
})
}); });
let radio_id = header.start_radio_button.and_then(|b| { let radio_id = header.start_radio_button.and_then(|b| {

View file

@ -80,7 +80,7 @@ impl RustyPipeQuery {
.enumerate() .enumerate()
.filter_map(|(i, track)| { .filter_map(|(i, track)| {
if track.is_video { if track.is_video {
Some((i, track.name.to_owned())) track.track_nr.map(|n| (i, n))
} else { } else {
None None
} }
@ -88,21 +88,12 @@ impl RustyPipeQuery {
.collect::<Vec<_>>(); .collect::<Vec<_>>();
if !to_replace.is_empty() { if !to_replace.is_empty() {
let playlist = self.music_playlist(playlist_id).await?; let playlist = self.playlist_w_unavail(playlist_id).await?;
for (i, title) in to_replace { for (i, track_n) in to_replace {
let found_track = playlist.tracks.items.iter().find_map(|track| { if let Some(t) = playlist.videos.items.get(track_n as usize - 1) {
if track.name == title && !track.is_video { album.tracks[i].id = t.id.to_owned();
Some((track.id.to_owned(), track.duration)) album.tracks[i].duration = Some(t.length);
} else {
None
}
});
if let Some((track_id, duration)) = found_track {
album.tracks[i].id = track_id;
if let Some(duration) = duration {
album.tracks[i].duration = Some(duration);
}
album.tracks[i].is_video = false; album.tracks[i].is_video = false;
} }
} }

View file

@ -9,7 +9,10 @@ use crate::{
util::{self, TryRemove}, util::{self, TryRemove},
}; };
use super::{response, ClientType, MapResponse, MapResult, QBrowse, QContinuation, RustyPipeQuery}; use super::{
response, ClientType, MapResponse, MapResult, QBrowse, QBrowseParams, QContinuation,
RustyPipeQuery,
};
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get a YouTube playlist /// Get a YouTube playlist
@ -31,6 +34,29 @@ impl RustyPipeQuery {
.await .await
} }
/// Get a YouTube playlist including unavailable tracks
pub(crate) async fn playlist_w_unavail<S: AsRef<str>>(
&self,
playlist_id: S,
) -> Result<Playlist, Error> {
let playlist_id = playlist_id.as_ref();
let context = self.get_context(ClientType::Desktop, true, None).await;
let request_body = QBrowseParams {
context,
browse_id: &format!("VL{playlist_id}"),
params: "wgYCCAA%3D",
};
self.execute_request::<response::Playlist, _, _>(
ClientType::Desktop,
"playlist",
playlist_id,
"browse",
&request_body,
)
.await
}
/// Get more playlist items using the given continuation token /// Get more playlist items using the given continuation token
pub async fn playlist_continuation<S: AsRef<str>>( pub async fn playlist_continuation<S: AsRef<str>>(
&self, &self,

View file

@ -611,29 +611,17 @@ impl MusicListMapper {
let (mut artists, by_va) = map_artists(artists_p); let (mut artists, by_va) = map_artists(artists_p);
// Extract artist id from dropdown menu
let artist_id = map_artist_id_fallback(item.menu, artists.first());
// Fall back to the artist given when constructing the mapper. // Fall back to the artist given when constructing the mapper.
// This is used for extracting artist pages. // This is used for extracting artist pages.
// On some albums, the artist name of the tracks is not given but different if let Some(a) = &self.artists {
// from the album artist. In this case dont copy the album artist. if artists.is_empty() {
if let Some((fb_artists, _)) = &self.artists { artists = a.0.clone();
if artists.is_empty()
&& (self.artist_page
|| artist_id.is_none()
|| fb_artists.iter().any(|fb_id| {
fb_id
.id
.as_deref()
.map(|aid| artist_id.as_deref() == Some(aid))
.unwrap_or_default()
}))
{
artists = fb_artists.clone();
} }
} }
// Extract artist id from dropdown menu
let artist_id = map_artist_id_fallback(item.menu, artists.first());
let track_nr = item.index.and_then(|txt| util::parse_numeric(&txt).ok()); let track_nr = item.index.and_then(|txt| util::parse_numeric(&txt).ok());
self.items.push(MusicItem::Track(TrackItem { self.items.push(MusicItem::Track(TrackItem {
@ -951,7 +939,6 @@ impl MusicListMapper {
} }
} }
/// Map TextComponents containing artist names to a list of artists and a 'Various Artists' flag
pub(crate) fn map_artists(artists_p: Option<TextComponents>) -> (Vec<ArtistId>, bool) { pub(crate) fn map_artists(artists_p: Option<TextComponents>) -> (Vec<ArtistId>, bool) {
let mut by_va = false; let mut by_va = false;
let artists = artists_p let artists = artists_p

View file

@ -33,7 +33,7 @@ MusicArtist(
), ),
], ],
description: Some("Senta-Sofia Delliponti is a German singer, songwriter and actress. Since January 2014, she used the stage name Oonagh, until she changed it to Senta in 2022. Her signature musical style is inspired by the mystical lore of J. R. R. Tolkien\'s universe and by ethnic sounds throughout the world.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Oonagh_(singer)) under Creative Commons Attribution CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/legalcode)"), description: Some("Senta-Sofia Delliponti is a German singer, songwriter and actress. Since January 2014, she used the stage name Oonagh, until she changed it to Senta in 2022. Her signature musical style is inspired by the mystical lore of J. R. R. Tolkien\'s universe and by ethnic sounds throughout the world.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Oonagh_(singer)) under Creative Commons Attribution CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/legalcode)"),
wikipedia_url: Some("https://en.wikipedia.org/wiki/Oonagh_(singer)"), wikipedia_url: Some("https://en.wikipedia.org/wiki/Oonagh_"),
subscriber_count: Some(34200), subscriber_count: Some(34200),
tracks: [ tracks: [
TrackItem( TrackItem(

File diff suppressed because it is too large Load diff

View file

@ -43,7 +43,7 @@ MusicAlbum(
TrackItem( TrackItem(
id: "Jz-26iiDuYs", id: "Jz-26iiDuYs",
name: "Waldbrand", name: "Waldbrand",
duration: Some(208), duration: Some(209),
cover: [], cover: [],
artists: [ artists: [
ArtistId( ArtistId(

View file

@ -0,0 +1,780 @@
---
source: tests/youtube.rs
expression: album
---
MusicAlbum(
id: "MPREb_RM0QfZ0eSKL",
playlist_id: Some("OLAK5uy_kJpQ8rrI50kwRV-FTS92jdE-RAkUnFFTc"),
name: "Wake Your Mind (Deluxe Edition)",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
description: Some("Wake Your Mind is the fifth studio album by German Trance duo Cosmic Gate. It was released on October 24, 2011 as a digital release on Beatport and October 31, 2011 on all other digital retailers.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Wake_Your_Mind) under Creative Commons Attribution CC-BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)"),
album_type: Album,
year: Some(2011),
by_va: false,
tracks: [
TrackItem(
id: "i2BXHjoK6Pc",
name: "Sometimes They Come Back for More",
duration: Some(448),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCeaHkytFYZHuP_5My8uhaRQ"),
name: "Arnej",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(1),
by_va: false,
),
TrackItem(
id: "HbjCfOa8P5Y",
name: "Be Your Sound",
duration: Some(252),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU-OklRKmlSN9FUhyvwkylg"),
name: "Emma Hewitt",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(2),
by_va: false,
),
TrackItem(
id: "qRicdCPpo9Q",
name: "Wake Your Mind",
duration: Some(365),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCc7OiFZMRwpZXRJ6jQas2pg"),
name: "Cary Brothers",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(3),
by_va: false,
),
TrackItem(
id: "Sdvmezb4uTw",
name: "The Theme",
duration: Some(260),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(4),
by_va: false,
),
TrackItem(
id: "hNDXx4vaoKs",
name: "All Around You",
duration: Some(334),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UC5hgy_aZwBDZLfxrMHFoD_Q"),
name: "Aruna",
),
ArtistId(
id: Some("UCq346_97fIcWXPiGOtqLPtg"),
name: "Shane 54",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(5),
by_va: false,
),
TrackItem(
id: "qB1Y4-O9MRM",
name: "Never Apart",
duration: Some(330),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCkWEAKM8DvaE0dEqPgxK-3Q"),
name: "Alana Aldea",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(6),
by_va: false,
),
TrackItem(
id: "bZkY60_Ohvs",
name: "Over the Rainbow",
duration: Some(293),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate and J\'Something",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(7),
by_va: false,
),
TrackItem(
id: "znQfnmObaDg",
name: "Nothing Ever Lasts",
duration: Some(368),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UC2-3iA9cVO3zmfqBpI_9SAw"),
name: "Andrew Bayer",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(8),
by_va: false,
),
TrackItem(
id: "Mu0HlrLCP44",
name: "Calm Down",
duration: Some(337),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU-OklRKmlSN9FUhyvwkylg"),
name: "Emma Hewitt",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(9),
by_va: false,
),
TrackItem(
id: "87L2Lqeaz4Y",
name: "Barra",
duration: Some(222),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(10),
by_va: false,
),
TrackItem(
id: "ZPrAwsjeUBo",
name: "Drifting Away",
duration: Some(336),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU22cXBIulEYuIjQ3ez7Cbg"),
name: "Cathy Burton",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(11),
by_va: false,
),
TrackItem(
id: "Y9FknSw3x6U",
name: "Flying Blind",
duration: Some(365),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCYMm13OXcL9llzuervQ1_Ig"),
name: "JES",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(12),
by_va: false,
),
TrackItem(
id: "w9SUevHpYaU",
name: "Perfect Stranger",
duration: Some(331),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(13),
by_va: false,
),
TrackItem(
id: "3UweyDiE1Og",
name: "Beautiful Destruction",
duration: Some(361),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCkWEAKM8DvaE0dEqPgxK-3Q"),
name: "Alana Aldea",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(14),
by_va: false,
),
TrackItem(
id: "huS3sgQ7ZiI",
name: "Free Falling [Barra]",
duration: Some(226),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UC5hgy_aZwBDZLfxrMHFoD_Q"),
name: "Aruna",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(15),
by_va: false,
),
TrackItem(
id: "PbTuejdARwQ",
name: "Sometimes They Come Back for More (Stoneface & Terminal Remix)",
duration: Some(463),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate and Arnej",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(16),
by_va: false,
),
TrackItem(
id: "B1u98t6fwjs",
name: "Be Your Sound (Orjan Nilsen Remix)",
duration: Some(537),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU-OklRKmlSN9FUhyvwkylg"),
name: "Emma Hewitt",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(17),
by_va: false,
),
TrackItem(
id: "npQDHZh3xps",
name: "Wake Your Mind (Tritonal Remix)",
duration: Some(416),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCc7OiFZMRwpZXRJ6jQas2pg"),
name: "Cary Brothers",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(18),
by_va: false,
),
TrackItem(
id: "mbgIthuB8dY",
name: "The Blue Theme (Ferry Corsten Fix)",
duration: Some(446),
cover: [],
artists: [
ArtistId(
id: Some("UC53Zmeku4tigP7KwAHxWX8A"),
name: "System F",
),
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC53Zmeku4tigP7KwAHxWX8A"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(19),
by_va: false,
),
TrackItem(
id: "uMfVA0Atofk",
name: "All Around You (Alexander Popov Remix)",
duration: Some(437),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCq346_97fIcWXPiGOtqLPtg"),
name: "Shane 54",
),
ArtistId(
id: Some("UC5hgy_aZwBDZLfxrMHFoD_Q"),
name: "Aruna",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(20),
by_va: false,
),
TrackItem(
id: "W_8gRFJOLsY",
name: "Never Apart (Steve Brian Remix)",
duration: Some(406),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCkWEAKM8DvaE0dEqPgxK-3Q"),
name: "Alana Aldea",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(21),
by_va: false,
),
TrackItem(
id: "p_0jK0XDrg8",
name: "Over the Rainbow (W&W Remix)",
duration: Some(339),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCx6EvdNe0luLrC_Rj8Wk10w"),
name: "JSomething",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(22),
by_va: false,
),
TrackItem(
id: "CdCjMlyjpAg",
name: "Nothing Ever Lasts (Nitrous Oxide Remix)",
duration: Some(455),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate and Andrew Bayer",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(23),
by_va: false,
),
TrackItem(
id: "c7yShI25Y-Q",
name: "Calm Down (Omnia Remix)",
duration: Some(391),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU-OklRKmlSN9FUhyvwkylg"),
name: "Emma Hewitt",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(24),
by_va: false,
),
TrackItem(
id: "gJB7xwuvREs",
name: "Drifting Away (Faruk Sabanci Remix)",
duration: Some(393),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
ArtistId(
id: Some("UCU22cXBIulEYuIjQ3ez7Cbg"),
name: "Cathy Burton",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(25),
by_va: false,
),
TrackItem(
id: "lfOhL0ah0lw",
name: "Flying Blind (Tom Fall Remix)",
duration: Some(469),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate and JES",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(26),
by_va: false,
),
TrackItem(
id: "ilrtbPk2RE8",
name: "Perfect Stranger (Wezz Devall Remix)",
duration: Some(404),
cover: [],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album: Some(AlbumId(
id: "MPREb_RM0QfZ0eSKL",
name: "Wake Your Mind (Deluxe Edition)",
)),
view_count: None,
is_video: false,
track_nr: Some(27),
by_va: false,
),
],
variants: [
AlbumItem(
id: "MPREb_75NZMCMZQW4",
name: "Wake Your Mind",
cover: [
Thumbnail(
url: "https://lh3.googleusercontent.com/gta0XN_TQLselp1ymFyIACP2_Px4wvoSdI0XKOAWKqlSuYvRGLg9FuKPX0DkJifUYAm7fNJmRpupyvgO=w226-h226-l90-rj",
width: 226,
height: 226,
),
Thumbnail(
url: "https://lh3.googleusercontent.com/gta0XN_TQLselp1ymFyIACP2_Px4wvoSdI0XKOAWKqlSuYvRGLg9FuKPX0DkJifUYAm7fNJmRpupyvgO=w544-h544-l90-rj",
width: 544,
height: 544,
),
],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album_type: Album,
year: None,
by_va: false,
),
AlbumItem(
id: "MPREb_csntSntqO8R",
name: "Wake Your Mind",
cover: [
Thumbnail(
url: "https://lh3.googleusercontent.com/Rxmu8lBHszFtHGyToeorDBCpT9pmNQBWZLq7KXfxysktTx-ebcrIOBwpfuNbaNtGvrAfTSvAZelB5dXT6w=w226-h226-l90-rj",
width: 226,
height: 226,
),
Thumbnail(
url: "https://lh3.googleusercontent.com/Rxmu8lBHszFtHGyToeorDBCpT9pmNQBWZLq7KXfxysktTx-ebcrIOBwpfuNbaNtGvrAfTSvAZelB5dXT6w=w544-h544-l90-rj",
width: 544,
height: 544,
),
],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album_type: Album,
year: None,
by_va: false,
),
AlbumItem(
id: "MPREb_lidKOifLvXm",
name: "Wake Your Mind (The Extended Mixes)",
cover: [
Thumbnail(
url: "https://lh3.googleusercontent.com/Odk-iPowyYddbohhb20Zf23qopAWms68hiWS1uHX_ej4Gab0-Dh3ZuhBIdumE6rqk5XD1faZhVBK59lg1Q=w226-h226-l90-rj",
width: 226,
height: 226,
),
Thumbnail(
url: "https://lh3.googleusercontent.com/Odk-iPowyYddbohhb20Zf23qopAWms68hiWS1uHX_ej4Gab0-Dh3ZuhBIdumE6rqk5XD1faZhVBK59lg1Q=w544-h544-l90-rj",
width: 544,
height: 544,
),
],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album_type: Album,
year: None,
by_va: false,
),
AlbumItem(
id: "MPREb_qSDBQBGK1bP",
name: "Wake Your Mind (Deluxe Edition)",
cover: [
Thumbnail(
url: "https://lh3.googleusercontent.com/R39ek9HrT7nWzVZNj2GUR3owNlbgyT7e-W-5SuPRRpLgbrE_OSTAy70LzLlk42ftNtbRJQYSMrat8VfSFg=w226-h226-l90-rj",
width: 226,
height: 226,
),
Thumbnail(
url: "https://lh3.googleusercontent.com/R39ek9HrT7nWzVZNj2GUR3owNlbgyT7e-W-5SuPRRpLgbrE_OSTAy70LzLlk42ftNtbRJQYSMrat8VfSFg=w544-h544-l90-rj",
width: 544,
height: 544,
),
],
artists: [
ArtistId(
id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
name: "Cosmic Gate",
),
],
artist_id: Some("UC2JiS71Dbgd_4bB4hMKebeg"),
album_type: Album,
year: None,
by_va: false,
),
],
)

View file

@ -1289,6 +1289,7 @@ fn music_playlist_not_found(rp: RustyPipe) {
#[case::no_year("no_year", "MPREb_F3Af9UZZVxX")] #[case::no_year("no_year", "MPREb_F3Af9UZZVxX")]
#[case::version_no_artist("version_no_artist", "MPREb_h8ltx5oKvyY")] #[case::version_no_artist("version_no_artist", "MPREb_h8ltx5oKvyY")]
#[case::no_artist("no_artist", "MPREb_bqWA6mAZFWS")] #[case::no_artist("no_artist", "MPREb_bqWA6mAZFWS")]
#[case::tn_zero("tn_zero", "MPREb_RM0QfZ0eSKL")]
fn music_album(#[case] name: &str, #[case] id: &str, rp: RustyPipe) { fn music_album(#[case] name: &str, #[case] id: &str, rp: RustyPipe) {
let album = tokio_test::block_on(rp.query().music_album(id)).unwrap(); let album = tokio_test::block_on(rp.query().music_album(id)).unwrap();