From 7e58a3717bb1cef0746e5841a3733e08cb4c01df Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:15:58 +0100 Subject: [PATCH] Try removing the first video from the imported playlist. --- testing/api-test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testing/api-test.sh b/testing/api-test.sh index 1f04525..abdb870 100755 --- a/testing/api-test.sh +++ b/testing/api-test.sh @@ -145,7 +145,10 @@ curl "${CURLOPTS[@]}" $HOST/user/playlists/clear -X POST -H "Content-Type: appli curl "${CURLOPTS[@]}" $HOST/user/playlists/delete -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$(jq -n --compact-output --arg playlistId "$PLAYLIST_ID" '{"playlistId": $playlistId}')" || exit 1 # Import Playlist Test -curl "${CURLOPTS[@]}" $HOST/import/playlist -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$(jq -n --compact-output --arg playlistId "PLQSoWXSpjA3-egtFq45DcUydZ885W7MTT" '{"playlistId": $playlistId}')" || exit 1 +IMPORTED_PLAYLIST_ID=$(curl -s -o - -f $HOST/import/playlist -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$(jq -n --compact-output --arg playlistId "PLQSoWXSpjA3-egtFq45DcUydZ885W7MTT" '{"playlistId": $playlistId}')" | jq -r .playlistId || exit 1) + +# Remove first video from playlist +curl "${CURLOPTS[@]}" $HOST/user/playlists/remove -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$(jq -n --compact-output --arg index "0" --arg playlistId "$IMPORTED_PLAYLIST_ID" '{"index": $index, "playlistId": $playlistId}')" || exit 1 # Delete User Test curl "${CURLOPTS[@]}" $HOST/user/delete -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$(jq -n --compact-output --arg password "$PASS" '{"password": $password}')" || exit 1