Compare commits

...

3 commits

Author SHA1 Message Date
cb1dc994d7
fix: parsing audiobook type for pt-PT
Some checks failed
CI / Test (push) Failing after 2m18s
2024-06-27 03:14:58 +02:00
85751b35ed
ci: create Artifactview PR comments 2024-06-27 03:14:27 +02:00
9f7b8405a7
test: fix tests 2024-06-27 03:13:59 +02:00
9 changed files with 107 additions and 82 deletions

View file

@ -28,3 +28,10 @@ jobs:
with: with:
name: test name: test
path: target/nextest/ci/junit.xml path: target/nextest/ci/junit.xml
- name: 🔗 Artifactview PR comment
if: ${{ always() && github.event_name == 'pull_request' }}
run: |
if [[ "$GITEA_ACTIONS" == "true" ]]; then RUN_NUMBER="$GITHUB_RUN_NUMBER"; else RUN_NUMBER="$GITHUB_RUN_ID"; fi
curl -SsL --fail-with-body -w "\n" -X POST https://av.thetadev.de/.well-known/api/prComment -H "Content-Type: application/json" \
--data '{"url": "'"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$RUN_NUMBER"'", "pr": ${{ github.event.number }}}'

View file

@ -1,15 +1,15 @@
test: test:
# cargo test --features=rss # cargo test --features=rss
cargo nextest run --features=rss --no-fail-fast --failure-output final cargo nextest run --features=rss --no-fail-fast --failure-output final --retries 1
unittest: unittest:
cargo nextest run --features=rss --no-fail-fast --failure-output final --lib cargo nextest run --features=rss --no-fail-fast --failure-output final --lib
testyt: testyt:
cargo nextest run --features=rss --no-fail-fast --failure-output final --test youtube cargo nextest run --features=rss --no-fail-fast --failure-output final --retries 1 --test youtube
testyt-localized: testyt-localized:
YT_LANG=th cargo nextest run --features=rss --no-fail-fast --failure-output final --test youtube YT_LANG=th cargo nextest run --features=rss --no-fail-fast --failure-output final --retries 1 --test youtube
testintl: testintl:
#!/usr/bin/env bash #!/usr/bin/env bash
@ -28,7 +28,7 @@ testintl:
for YT_LANG in "${LANGUAGES[@]}"; do for YT_LANG in "${LANGUAGES[@]}"; do
echo "---TESTS FOR $YT_LANG ---" echo "---TESTS FOR $YT_LANG ---"
if YT_LANG="$YT_LANG" cargo test --test youtube -- --test-threads 4 --skip resolve; then if YT_LANG="$YT_LANG" cargo nextest run --no-fail-fast --failure-output final --retries 1 --test-threads 4 --test youtube -E 'not test(/^resolve/)'; then
echo "--- $YT_LANG COMPLETED ---" echo "--- $YT_LANG COMPLETED ---"
else else
echo "--- $YT_LANG FAILED ---" echo "--- $YT_LANG FAILED ---"

View file

@ -159,6 +159,7 @@ Subscribers: 1780000
- Current version of stable Rust - Current version of stable Rust
- [`just`](https://github.com/casey/just) task runner - [`just`](https://github.com/casey/just) task runner
- [`nextest`](https://nexte.st) test runner
- [`pre-commit`](https://pre-commit.com/) - [`pre-commit`](https://pre-commit.com/)
- yq (YAML processor) - yq (YAML processor)

View file

@ -5418,16 +5418,16 @@ pub(crate) fn entry(lang: Language) -> Entry {
], ],
}, },
album_types: ::phf::Map { album_types: ::phf::Map {
key: 12913932095322966823, key: 15467950696543387533,
disps: &[ disps: &[
(1, 0), (2, 0),
], ],
entries: &[ entries: &[
("álbum", AlbumType::Album), ("álbum", AlbumType::Album),
("single", AlbumType::Single),
("ep", AlbumType::Ep), ("ep", AlbumType::Ep),
("single", AlbumType::Single),
("programa", AlbumType::Show), ("programa", AlbumType::Show),
("livro áudio", AlbumType::Audiobook), ("audiolivro", AlbumType::Audiobook),
], ],
}, },
}, },

View file

@ -3184,7 +3184,7 @@
"number_nd_tokens": {}, "number_nd_tokens": {},
"album_types": { "album_types": {
"álbum": "Album", "álbum": "Album",
"livro áudio": "Audiobook", "audiolivro": "Audiobook",
"ep": "Ep", "ep": "Ep",
"programa": "Show", "programa": "Show",
"single": "Single" "single": "Single"

View file

@ -16,7 +16,21 @@ MusicAlbum(
artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"), artist_id: Some("UCwem2sj-QUJCiWiPAo9JuAw"),
description: Some(RichText([ description: Some(RichText([
Text( Text(
text: "Unbroken is the third studio album by American singer Demi Lovato. It was released on September 20, 2011, by Hollywood Records. Primarily a pop record, Lovato described the album as \"more mature\" and with more R&B elements than her previous material, citing Rihanna as the major influence. While some of the album\'s lyrical content was heavily influenced by Lovato\'s personal struggles, it also deals with lighter subjects, such as love and self empowerment. Contributions to the album\'s production came from a wide range of producers, including Toby Gad, Ryan Tedder, Timbaland, Jim Beanz and Rock Mafia.\nLovato initially began recording her third studio album in 2010 before going on tour with the Jonas Brothers on their Live in Concert Tour. After withdrawing from the tour to seek treatment for physical and emotional issues, Lovato continued work on the album and described the recording process as therapeutic. She collaborated with artists such as Missy Elliott, Timbaland, Dev, Iyaz, and Jason Derulo on several tracks.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Unbroken_(Demi_Lovato_album)) under Creative Commons Attribution CC-BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)", text: "Unbroken is the third studio album by American singer Demi Lovato. It was released on September 20, 2011, by Hollywood Records. Primarily a pop record, Lovato described the album as \"more mature\" and with more R&B elements than her previous material, citing Rihanna as the major influence. While some of the album\'s lyrical content was heavily influenced by Lovato\'s personal struggles, it also deals with lighter subjects, such as love and self empowerment. Contributions to the album\'s production came from a wide range of producers, including Toby Gad, Ryan Tedder, Timbaland, Jim Beanz and Rock Mafia.\nLovato initially began recording her third studio album in 2010 before going on tour with the Jonas Brothers on their Live in Concert Tour. After withdrawing from the tour to seek treatment for physical and emotional issues, Lovato continued work on the album and described the recording process as therapeutic. She collaborated with artists such as Missy Elliott, Timbaland, Dev, Iyaz, and Jason Derulo on several tracks.\n\nFrom Wikipedia (",
),
Web(
text: "https://en.wikipedia.org/wiki/Unbroke...",
url: "https://en.wikipedia.org/wiki/Unbroken_(Demi_Lovato_album)",
),
Text(
text: ") under Creative Commons Attribution CC-BY-SA 3.0 (",
),
Web(
text: "https://creativecommons.org/licenses/...",
url: "https://creativecommons.org/licenses/by-sa/3.0/legalcode",
),
Text(
text: ")",
), ),
])), ])),
album_type: Album, album_type: Album,

View file

@ -42,8 +42,8 @@ MusicArtist(
by_va: false, by_va: false,
), ),
AlbumItem( AlbumItem(
id: "MPREb_6PEkIQE7sWY", id: "MPREb_HrCgErOdgCv",
name: "An deiner Seite (Online Version)", name: "Freiheit",
cover: "[cover]", cover: "[cover]",
artists: [ artists: [
ArtistId( ArtistId(
@ -52,8 +52,8 @@ MusicArtist(
), ),
], ],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"), artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Ep, album_type: Album,
year: Some(2008), year: Some(2004),
by_va: false, by_va: false,
), ),
AlbumItem( AlbumItem(
@ -101,21 +101,6 @@ MusicArtist(
year: Some(2012), year: Some(2012),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_QyGCcLWExXj",
name: "Als wär\'s das erste Mal (Exklusive Piano Version)",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "Unheilig",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Single,
year: Some(2014),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_R3p5kDRIGKL", id: "MPREb_R3p5kDRIGKL",
name: "Astronaut", name: "Astronaut",
@ -206,6 +191,21 @@ MusicArtist(
year: Some(2021), year: Some(2021),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_bUKkpmkyv9M",
name: "Als wär\'s das erste Mal",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "Unheilig",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Single,
year: Some(2014),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_f4MhYbccbPi", id: "MPREb_f4MhYbccbPi",
name: "Moderne Zeiten", name: "Moderne Zeiten",
@ -251,6 +251,21 @@ MusicArtist(
year: Some(2015), year: Some(2015),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_ohcGTZrqKPZ",
name: "Zelluloid",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "Unheilig",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Album,
year: Some(2004),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_pWpeXxATZYb", id: "MPREb_pWpeXxATZYb",
name: "Wir sind alle wie eins", name: "Wir sind alle wie eins",
@ -266,21 +281,6 @@ MusicArtist(
year: Some(2014), year: Some(2014),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_rHhaDLqalbT",
name: "Winter (EP)",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "Unheilig",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Ep,
year: Some(2010),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_saXgTKNPaSu", id: "MPREb_saXgTKNPaSu",
name: "Zeit zu gehen", name: "Zeit zu gehen",

View file

@ -42,7 +42,7 @@ MusicArtist(
by_va: false, by_va: false,
), ),
AlbumItem( AlbumItem(
id: "MPREb_6PEkIQE7sWY", id: "MPREb_HrCgErOdgCv",
name: "[name]", name: "[name]",
cover: "[cover]", cover: "[cover]",
artists: [ artists: [
@ -52,8 +52,8 @@ MusicArtist(
), ),
], ],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"), artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Ep, album_type: Album,
year: Some(2008), year: Some(2004),
by_va: false, by_va: false,
), ),
AlbumItem( AlbumItem(
@ -101,21 +101,6 @@ MusicArtist(
year: Some(2012), year: Some(2012),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_QyGCcLWExXj",
name: "[name]",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "[name]",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Single,
year: Some(2014),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_R3p5kDRIGKL", id: "MPREb_R3p5kDRIGKL",
name: "[name]", name: "[name]",
@ -206,6 +191,21 @@ MusicArtist(
year: Some(2021), year: Some(2021),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_bUKkpmkyv9M",
name: "[name]",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "[name]",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Single,
year: Some(2014),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_f4MhYbccbPi", id: "MPREb_f4MhYbccbPi",
name: "[name]", name: "[name]",
@ -251,6 +251,21 @@ MusicArtist(
year: Some(2015), year: Some(2015),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_ohcGTZrqKPZ",
name: "[name]",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "[name]",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Album,
year: Some(2004),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_pWpeXxATZYb", id: "MPREb_pWpeXxATZYb",
name: "[name]", name: "[name]",
@ -266,21 +281,6 @@ MusicArtist(
year: Some(2014), year: Some(2014),
by_va: false, by_va: false,
), ),
AlbumItem(
id: "MPREb_rHhaDLqalbT",
name: "[name]",
cover: "[cover]",
artists: [
ArtistId(
id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
name: "[name]",
),
],
artist_id: Some("UC7cl4MmM6ZZ2TcFyMk_b4pg"),
album_type: Ep,
year: Some(2010),
by_va: false,
),
AlbumItem( AlbumItem(
id: "MPREb_saXgTKNPaSu", id: "MPREb_saXgTKNPaSu",
name: "[name]", name: "[name]",

View file

@ -352,7 +352,7 @@ async fn get_player_error_paid(rp: RustyPipe) {
#[rstest] #[rstest]
#[case::long( #[case::long(
"PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ", "PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ",
"Die schönsten deutschen Lieder | Beliebteste Lieder | Beste Deutsche Musik 2022", "Die schönsten deutschen Lieder | Beliebteste Lieder | Beste Deutsche Musik 2020 2022",
true, true,
None, None,
Some(("UCIekuFeMaV78xYfvpmoCnPg", "Best Music")), Some(("UCIekuFeMaV78xYfvpmoCnPg", "Best Music")),
@ -1464,7 +1464,7 @@ async fn trending(rp: RustyPipe) {
#[rstest] #[rstest]
#[case::long( #[case::long(
"PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ", "PL5dDx681T4bR7ZF1IuWzOv1omlRbE7PiJ",
"Die schönsten deutschen Lieder | Beliebteste Lieder | Beste Deutsche Musik 2022", "Die schönsten deutschen Lieder | Beliebteste Lieder | Beste Deutsche Musik 2020 2022",
true, true,
None, None,
Some(("UCIekuFeMaV78xYfvpmoCnPg", "Best Music")), Some(("UCIekuFeMaV78xYfvpmoCnPg", "Best Music")),
@ -1630,7 +1630,7 @@ async fn music_album_not_found(rp: RustyPipe) {
#[rstest] #[rstest]
#[case::basic_all("basic_all", "UCFKUUtHjT4iq3p0JJA13SOA", true, 15, 1)] #[case::basic_all("basic_all", "UCFKUUtHjT4iq3p0JJA13SOA", true, 15, 1)]
#[case::basic("basic", "UC7cl4MmM6ZZ2TcFyMk_b4pg", false, 15, 2)] #[case::basic("basic", "UC7cl4MmM6ZZ2TcFyMk_b4pg", false, 15, 0)]
#[case::no_more_albums("no_more_albums", "UCOR4_bSVIXPsGa4BbCSt60Q", true, 15, 0)] #[case::no_more_albums("no_more_albums", "UCOR4_bSVIXPsGa4BbCSt60Q", true, 15, 0)]
#[case::only_singles("only_singles", "UCfwCE5VhPMGxNPFxtVv7lRw", false, 13, 0)] #[case::only_singles("only_singles", "UCfwCE5VhPMGxNPFxtVv7lRw", false, 13, 0)]
#[case::no_artist("no_artist", "UCh8gHdtzO2tXd593_bjErWg", false, 0, 0)] #[case::no_artist("no_artist", "UCh8gHdtzO2tXd593_bjErWg", false, 0, 0)]
@ -2187,7 +2187,8 @@ async fn music_search_genre_radio(rp: RustyPipe) {
} }
#[rstest] #[rstest]
#[case::default("ed sheer", Some("ed sheeran"), Some("UClmXPfaYhXOYsNn_QUyheWQ"))] // TODO: reenable when music search suggestions work again
// #[case::default("ed sheer", Some("ed sheeran"), Some("UClmXPfaYhXOYsNn_QUyheWQ"))]
#[case::empty("reujbhevmfndxnjrze", None, None)] #[case::empty("reujbhevmfndxnjrze", None, None)]
#[tokio::test] #[tokio::test]
async fn music_search_suggestion( async fn music_search_suggestion(
@ -2548,7 +2549,9 @@ async fn music_genres(rp: RustyPipe, unlocalized: bool) {
.iter() .iter()
.find(|g| g.id == "ggMPOg1uX1lMbVZmbzl6NlJ3" || g.id == "ggMPOg1uX1BmNzc2V2p0YXJ5") .find(|g| g.id == "ggMPOg1uX1lMbVZmbzl6NlJ3" || g.id == "ggMPOg1uX1BmNzc2V2p0YXJ5")
.expect("genre: Pop"); .expect("genre: Pop");
if unlocalized {
assert_eq!(pop.name, "Pop"); assert_eq!(pop.name, "Pop");
}
assert!(!pop.is_mood); assert!(!pop.is_mood);
for g in &genres { for g in &genres {