2 Commits

Author SHA1 Message Date
6b3629436a disable arm target
All checks were successful
tests / fmt (push) Successful in 1m14s
tests / clippy (push) Successful in 1m14s
tests / pre-commit (push) Successful in 1m14s
tests / build (push) Successful in 1m26s
tests / test (push) Successful in 1m27s
2024-06-18 11:14:42 +02:00
feccbebd4d add error message for playlists that do not exist
Some checks failed
tests / fmt (push) Successful in 2m7s
tests / pre-commit (push) Successful in 2m24s
tests / clippy (push) Successful in 2m25s
tests / test (push) Successful in 2m29s
tests / build (push) Successful in 2m45s
deploy / release-image (push) Has been cancelled
2024-06-18 11:03:45 +02:00
2 changed files with 19 additions and 1 deletions

View File

@@ -26,6 +26,6 @@ jobs:
with: with:
platforms: | platforms: |
linux/amd64 linux/amd64
linux/arm64 # linux/arm64
push: true push: true
tags: jheuel/ohrwurm:latest tags: jheuel/ohrwurm:latest

View File

@@ -53,6 +53,9 @@ async fn get_tracks(
if stderr.contains("This video is only available to Music Premium members") { if stderr.contains("This video is only available to Music Premium members") {
return Err("This video is only available to Music Premium members".into()); return Err("This video is only available to Music Premium members".into());
} }
if stderr.contains("YouTube said: The playlist does not exist.") {
return Err("YouTube said: The playlist does not exist.".into());
}
} }
return Err("No tracks found".into()); return Err("No tracks found".into());
} }
@@ -274,4 +277,19 @@ mod tests {
.contains("This video is only available to Music Premium members")); .contains("This video is only available to Music Premium members"));
} }
} }
#[tokio::test]
async fn test_playlist_does_not_exist_tracks() {
let urls = ["https://www.youtube.com/playlist?list=PLox0oG0uy8Lc1IaIfGyrvtuRItuEyJiyG"];
for url in urls.iter() {
println!("url: {:?}", url);
let tracks = get_tracks(url.to_string()).await;
assert!(tracks.is_err());
assert!(tracks
.err()
.unwrap()
.to_string()
.contains("YouTube said: The playlist does not exist."));
}
}
} }