From 8f0e1468395909a164ebb7b85c693d0111d41c89 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Tue, 2 Jan 2024 18:01:32 +0100 Subject: [PATCH 1/4] chore: update dependencies --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3beeed8..8803f28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ quick-js-dtp = { version = "0.4.1", default-features = false, features = [ ] } once_cell = "1.12.0" regex = "1.6.0" -fancy-regex = "0.12.0" +fancy-regex = "0.13.0" thiserror = "1.0.36" url = "2.2.2" reqwest = { version = "0.11.11", default-features = false, features = [ From 11fe9a5fa1c7eeb34055d3c232b4ec94ebcccd75 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 18 Jan 2024 13:21:10 +0100 Subject: [PATCH 2/4] fix(tests): update YTM snapshots --- .../youtube__music_album_no_artist.snap | 4 +- .../youtube__music_album_no_artist_intl.snap | 4 +- .../youtube__music_album_one_artist.snap | 20 ++++ .../youtube__music_album_one_artist_intl.snap | 20 ++++ .../snapshots/youtube__music_album_show.snap | 112 ++++++++++++++++++ .../youtube__music_album_show_intl.snap | 112 ++++++++++++++++++ .../youtube__music_album_unavailable.snap | 25 +++- ...youtube__music_album_unavailable_intl.snap | 25 +++- .../youtube__music_album_various_artists.snap | 4 +- ...ube__music_album_various_artists_intl.snap | 4 +- .../youtube__music_artist_basic_all_intl.snap | 15 +++ 11 files changed, 329 insertions(+), 16 deletions(-) diff --git a/tests/snapshots/youtube__music_album_no_artist.snap b/tests/snapshots/youtube__music_album_no_artist.snap index 60a3b5b..eea1c14 100644 --- a/tests/snapshots/youtube__music_album_no_artist.snap +++ b/tests/snapshots/youtube__music_album_no_artist.snap @@ -63,11 +63,11 @@ MusicAlbum( cover: [], artists: [ ArtistId( - id: None, + id: Some("UCUhWwvF6gIPWTYlYb4-icLA"), name: "L.r. Eswari", ), ], - artist_id: None, + artist_id: Some("UCUhWwvF6gIPWTYlYb4-icLA"), album: Some(AlbumId( id: "MPREb_bqWA6mAZFWS", name: "Pedha Rasi Peddamma Katha", diff --git a/tests/snapshots/youtube__music_album_no_artist_intl.snap b/tests/snapshots/youtube__music_album_no_artist_intl.snap index c450608..a8cefcf 100644 --- a/tests/snapshots/youtube__music_album_no_artist_intl.snap +++ b/tests/snapshots/youtube__music_album_no_artist_intl.snap @@ -63,11 +63,11 @@ MusicAlbum( cover: [], artists: [ ArtistId( - id: None, + id: Some("UCUhWwvF6gIPWTYlYb4-icLA"), name: "[name]", ), ], - artist_id: None, + artist_id: Some("UCUhWwvF6gIPWTYlYb4-icLA"), album: Some(AlbumId( id: "MPREb_bqWA6mAZFWS", name: "[name]", diff --git a/tests/snapshots/youtube__music_album_one_artist.snap b/tests/snapshots/youtube__music_album_one_artist.snap index 25f4647..14f672c 100644 --- a/tests/snapshots/youtube__music_album_one_artist.snap +++ b/tests/snapshots/youtube__music_album_one_artist.snap @@ -29,6 +29,14 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "Demi Lovato", ), + ArtistId( + id: Some("UCKqVP7_535ELJu2OeEd3zzQ"), + name: "Missy Elliott", + ), + ArtistId( + id: Some("UCStR3TnjvL7CL8ZNFPKmRXw"), + name: "Timbaland", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -50,6 +58,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "Demi Lovato", ), + ArtistId( + id: Some("UC58M_VmdxEw-h-p_HgeE0Zg"), + name: "Dev", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -71,6 +83,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "Demi Lovato", ), + ArtistId( + id: Some("UC0tIFKS5uijPeJLjH8uAWJg"), + name: "Iyaz", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -92,6 +108,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "Demi Lovato", ), + ArtistId( + id: Some("UCA7oqkXUZIlT8QXhxaIR4RA"), + name: "Jason Derulo", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( diff --git a/tests/snapshots/youtube__music_album_one_artist_intl.snap b/tests/snapshots/youtube__music_album_one_artist_intl.snap index 26c2e91..d67935f 100644 --- a/tests/snapshots/youtube__music_album_one_artist_intl.snap +++ b/tests/snapshots/youtube__music_album_one_artist_intl.snap @@ -29,6 +29,14 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "[name]", ), + ArtistId( + id: Some("UCKqVP7_535ELJu2OeEd3zzQ"), + name: "[name]", + ), + ArtistId( + id: Some("UCStR3TnjvL7CL8ZNFPKmRXw"), + name: "[name]", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -50,6 +58,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "[name]", ), + ArtistId( + id: Some("UC58M_VmdxEw-h-p_HgeE0Zg"), + name: "[name]", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -71,6 +83,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "[name]", ), + ArtistId( + id: Some("UC0tIFKS5uijPeJLjH8uAWJg"), + name: "[name]", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( @@ -92,6 +108,10 @@ MusicAlbum( id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), name: "[name]", ), + ArtistId( + id: Some("UCA7oqkXUZIlT8QXhxaIR4RA"), + name: "[name]", + ), ], artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), album: Some(AlbumId( diff --git a/tests/snapshots/youtube__music_album_show.snap b/tests/snapshots/youtube__music_album_show.snap index 43d312a..570534a 100644 --- a/tests/snapshots/youtube__music_album_show.snap +++ b/tests/snapshots/youtube__music_album_show.snap @@ -12,6 +12,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), description: None, @@ -29,6 +33,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -50,6 +58,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -71,6 +83,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -92,6 +108,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -113,6 +133,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -134,6 +158,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -155,6 +183,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -176,6 +208,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -197,6 +233,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -218,6 +258,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -239,6 +283,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -260,6 +308,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -281,6 +333,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -302,6 +358,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -323,6 +383,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -344,6 +408,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -365,6 +433,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -386,6 +458,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -407,6 +483,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -428,6 +508,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -449,6 +533,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -470,6 +558,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -491,6 +583,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -512,6 +608,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -533,6 +633,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -554,6 +658,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -575,6 +683,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "Dimiter Inkiow", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "Griechische Mythologie für Kinder", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( diff --git a/tests/snapshots/youtube__music_album_show_intl.snap b/tests/snapshots/youtube__music_album_show_intl.snap index ff8113f..219157c 100644 --- a/tests/snapshots/youtube__music_album_show_intl.snap +++ b/tests/snapshots/youtube__music_album_show_intl.snap @@ -12,6 +12,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), description: "[description]", @@ -29,6 +33,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -50,6 +58,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -71,6 +83,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -92,6 +108,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -113,6 +133,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -134,6 +158,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -155,6 +183,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -176,6 +208,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -197,6 +233,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -218,6 +258,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -239,6 +283,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -260,6 +308,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -281,6 +333,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -302,6 +358,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -323,6 +383,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -344,6 +408,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -365,6 +433,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -386,6 +458,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -407,6 +483,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -428,6 +508,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -449,6 +533,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -470,6 +558,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -491,6 +583,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -512,6 +608,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -533,6 +633,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -554,6 +658,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( @@ -575,6 +683,10 @@ MusicAlbum( id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), name: "[name]", ), + ArtistId( + id: Some("UCsg6xTDzVnvrcWhgLYX6_rg"), + name: "[name]", + ), ], artist_id: Some("UCAotr_lJ3JJ79DPRlA7k47w"), album: Some(AlbumId( diff --git a/tests/snapshots/youtube__music_album_unavailable.snap b/tests/snapshots/youtube__music_album_unavailable.snap index ef83f26..57bcba2 100644 --- a/tests/snapshots/youtube__music_album_unavailable.snap +++ b/tests/snapshots/youtube__music_album_unavailable.snap @@ -7,12 +7,25 @@ MusicAlbum( playlist_id: Some("OLAK5uy_mux5ygfN9sbiR1ma3yh1GHTmqNekZNoAI"), name: "13 Reasons Why (Season 3)", cover: "[cover]", - artists: [], - artist_id: None, + artists: [ + ArtistId( + id: Some("UCCj0RlDqqahEB5BXVtDcPqg"), + name: "5 Seconds of Summer", + ), + ArtistId( + id: Some("UCMrCoizKiBxqeg5pTpBXn1A"), + name: "YUNGBLUD", + ), + ArtistId( + id: Some("UCvsgN5NKOzXnAURfaf3TOig"), + name: "Alexander 23", + ), + ], + artist_id: Some("UCCj0RlDqqahEB5BXVtDcPqg"), description: None, album_type: Album, year: Some(2019), - by_va: true, + by_va: false, tracks: [ TrackItem( id: "R3VIKRtzAdE", @@ -251,12 +264,16 @@ MusicAlbum( duration: Some(246), cover: [], artists: [ + ArtistId( + id: Some("UCRBHsrbsZDxjHkcgMKEJwpw"), + name: "Brendan Angelides", + ), ArtistId( id: Some("UC4YvDAbE1EYwZpj6gQ-lpLw"), name: "Eskmo", ), ], - artist_id: Some("UC4YvDAbE1EYwZpj6gQ-lpLw"), + artist_id: Some("UCRBHsrbsZDxjHkcgMKEJwpw"), album: Some(AlbumId( id: "MPREb_AzuWg8qAVVl", name: "13 Reasons Why (Season 3)", diff --git a/tests/snapshots/youtube__music_album_unavailable_intl.snap b/tests/snapshots/youtube__music_album_unavailable_intl.snap index cdf785d..36c8a58 100644 --- a/tests/snapshots/youtube__music_album_unavailable_intl.snap +++ b/tests/snapshots/youtube__music_album_unavailable_intl.snap @@ -7,12 +7,25 @@ MusicAlbum( playlist_id: Some("OLAK5uy_mux5ygfN9sbiR1ma3yh1GHTmqNekZNoAI"), name: "[name]", cover: "[cover]", - artists: [], - artist_id: None, + artists: [ + ArtistId( + id: Some("UCCj0RlDqqahEB5BXVtDcPqg"), + name: "[name]", + ), + ArtistId( + id: Some("UCMrCoizKiBxqeg5pTpBXn1A"), + name: "[name]", + ), + ArtistId( + id: Some("UCvsgN5NKOzXnAURfaf3TOig"), + name: "[name]", + ), + ], + artist_id: Some("UCCj0RlDqqahEB5BXVtDcPqg"), description: "[description]", album_type: Album, year: Some(2019), - by_va: true, + by_va: false, tracks: [ TrackItem( id: "R3VIKRtzAdE", @@ -251,12 +264,16 @@ MusicAlbum( duration: Some(246), cover: [], artists: [ + ArtistId( + id: Some("UCRBHsrbsZDxjHkcgMKEJwpw"), + name: "[name]", + ), ArtistId( id: Some("UC4YvDAbE1EYwZpj6gQ-lpLw"), name: "[name]", ), ], - artist_id: Some("UC4YvDAbE1EYwZpj6gQ-lpLw"), + artist_id: Some("UCRBHsrbsZDxjHkcgMKEJwpw"), album: Some(AlbumId( id: "MPREb_AzuWg8qAVVl", name: "[name]", diff --git a/tests/snapshots/youtube__music_album_various_artists.snap b/tests/snapshots/youtube__music_album_various_artists.snap index eac36e1..75ffe38 100644 --- a/tests/snapshots/youtube__music_album_various_artists.snap +++ b/tests/snapshots/youtube__music_album_various_artists.snap @@ -105,11 +105,11 @@ MusicAlbum( cover: [], artists: [ ArtistId( - id: None, + id: Some("UCa4ZqZPRjz9MYYnfpoh2few"), name: "LOONA", ), ], - artist_id: None, + artist_id: Some("UCa4ZqZPRjz9MYYnfpoh2few"), album: Some(AlbumId( id: "MPREb_8QkDeEIawvX", name: "<Queendom2> FINAL", diff --git a/tests/snapshots/youtube__music_album_various_artists_intl.snap b/tests/snapshots/youtube__music_album_various_artists_intl.snap index f44751e..6215266 100644 --- a/tests/snapshots/youtube__music_album_various_artists_intl.snap +++ b/tests/snapshots/youtube__music_album_various_artists_intl.snap @@ -105,11 +105,11 @@ MusicAlbum( cover: [], artists: [ ArtistId( - id: None, + id: Some("UCa4ZqZPRjz9MYYnfpoh2few"), name: "[name]", ), ], - artist_id: None, + artist_id: Some("UCa4ZqZPRjz9MYYnfpoh2few"), album: Some(AlbumId( id: "MPREb_8QkDeEIawvX", name: "[name]", diff --git a/tests/snapshots/youtube__music_artist_basic_all_intl.snap b/tests/snapshots/youtube__music_artist_basic_all_intl.snap index 7e30c47..4a7ad20 100644 --- a/tests/snapshots/youtube__music_artist_basic_all_intl.snap +++ b/tests/snapshots/youtube__music_artist_basic_all_intl.snap @@ -146,6 +146,21 @@ MusicArtist( year: Some(2015), by_va: false, ), + AlbumItem( + id: "MPREb_ghrNI6BJSM8", + name: "[name]", + cover: "[cover]", + artists: [ + ArtistId( + id: Some("UCFKUUtHjT4iq3p0JJA13SOA"), + name: "[name]", + ), + ], + artist_id: Some("UCFKUUtHjT4iq3p0JJA13SOA"), + album_type: Album, + year: Some(2017), + by_va: false, + ), AlbumItem( id: "MPREb_h0UZr2ALQXf", name: "[name]", From 9ecf7eff74eb1c9b98a198bb5559ab67bc2c4d97 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 18 Jan 2024 13:23:56 +0100 Subject: [PATCH 3/4] chore: fix clippy lints --- src/client/channel.rs | 2 +- src/client/music_playlist.rs | 2 +- src/client/response/mod.rs | 14 ++++++++------ src/lib.rs | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/client/channel.rs b/src/client/channel.rs index 1907160..85ecfb3 100644 --- a/src/client/channel.rs +++ b/src/client/channel.rs @@ -529,7 +529,7 @@ fn map_channel_content( .content .section_list_renderer .as_ref() - .and_then(|c| c.contents.c.get(0)) + .and_then(|c| c.contents.c.first()) { return Err(ExtractionError::Unavailable { reason: crate::error::UnavailabilityReason::AgeRestricted, diff --git a/src/client/music_playlist.rs b/src/client/music_playlist.rs index 49350fb..d3fb2a9 100644 --- a/src/client/music_playlist.rs +++ b/src/client/music_playlist.rs @@ -327,7 +327,7 @@ impl MapResponse for response::MusicPlaylist { let year_txt = subtitle_split .swap_remove(2) .0 - .get(0) + .first() .map(|c| c.as_str().to_owned()); (year_txt, subtitle_split.try_swap_remove(1)) } diff --git a/src/client/response/mod.rs b/src/client/response/mod.rs index 237c930..47f0b81 100644 --- a/src/client/response/mod.rs +++ b/src/client/response/mod.rs @@ -335,12 +335,14 @@ impl From for Vec { impl From> for crate::model::Verification { fn from(badges: Vec) -> Self { - badges.get(0).map_or(crate::model::Verification::None, |b| { - match b.metadata_badge_renderer.style { - ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified, - ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist, - } - }) + badges + .first() + .map_or(crate::model::Verification::None, |b| { + match b.metadata_badge_renderer.style { + ChannelBadgeStyle::BadgeStyleTypeVerified => Self::Verified, + ChannelBadgeStyle::BadgeStyleTypeVerifiedArtist => Self::Artist, + } + }) } } diff --git a/src/lib.rs b/src/lib.rs index e6868d8..2f4fa34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ #![allow( clippy::doc_markdown, clippy::similar_names, + clippy::struct_field_names, clippy::items_after_statements, clippy::too_many_lines, clippy::module_name_repetitions, From d38a1366e738db92f1b7a98e144d30ee340209ae Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 18 Jan 2024 13:32:24 +0100 Subject: [PATCH 4/4] tests: disable channel shorts tests --- tests/youtube.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/youtube.rs b/tests/youtube.rs index ded1a58..1207df8 100644 --- a/tests/youtube.rs +++ b/tests/youtube.rs @@ -827,6 +827,7 @@ fn channel_videos(rp: RustyPipe) { } #[rstest] +#[ignore] fn channel_shorts(rp: RustyPipe) { let channel = tokio_test::block_on( rp.query() @@ -1006,8 +1007,9 @@ fn channel_more( #[rstest] #[case::videos("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Videos)] -#[case::shorts("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Shorts)] #[case::live("UCvqRdlKsE5Q8mf8YXbdIJLw", ChannelVideoTab::Live)] +#[ignore] +#[case::shorts("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Shorts)] fn channel_order_latest(#[case] id: &str, #[case] tab: ChannelVideoTab, rp: RustyPipe) { let latest = tokio_test::block_on(rp.query().channel_videos_tab_order( id, @@ -1033,8 +1035,9 @@ fn channel_order_latest(#[case] id: &str, #[case] tab: ChannelVideoTab, rp: Rust #[rstest] #[case::videos("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Videos, "XqZsoesa55w")] -#[case::shorts("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Shorts, "k91vRvXGwHs")] #[case::live("UCvqRdlKsE5Q8mf8YXbdIJLw", ChannelVideoTab::Live, "ojes5ULOqhc")] +#[ignore] +#[case::shorts("UCcdwLMPsaU2ezNSJU1nFoBQ", ChannelVideoTab::Shorts, "k91vRvXGwHs")] fn channel_order_popular( #[case] id: &str, #[case] tab: ChannelVideoTab,