updated spotify_delete_duplicates_in_playlist.sh

pull/2/head
Hari Sekhon 4 years ago
parent 30e9f2de29
commit d618df975b

@ -41,25 +41,24 @@ $usage_auth_help
# used by usage() in lib/utils.sh
# shellcheck disable=SC2034
usage_args="<playlist_name_or_id>"
usage_args="<playlist_name_or_id> [<playlist2> <playlist3> ...]"
help_usage "$@"
min_args 1 "$@"
playlist="$1"
shift || :
# requires authorized token
export SPOTIFY_PRIVATE=1
spotify_token
# this script returns the ID if it's already in the correct format, otherwise queries and returns the playlist ID for the playlist
playlist_id="$(SPOTIFY_PLAYLIST_EXACT_MATCH=1 "$srcdir/spotify_playlist_name_to_id.sh" "$playlist")"
export SPOTIFY_DUPLICATE_TRACK_POSITIONS=1
timestamp "Finding and deleting duplicates in playlist \"$playlist\" by exact URI match:"
"$srcdir/spotify_duplicate_uri_in_playlist.sh" "$playlist_id" |
"$srcdir/spotify_delete_from_playlist.sh" "$playlist_id"
for playlist in "$@"; do
# this script returns the ID if it's already in the correct format, otherwise queries and returns the playlist ID for the playlist
playlist_id="$(SPOTIFY_PLAYLIST_EXACT_MATCH=1 "$srcdir/spotify_playlist_name_to_id.sh" "$playlist")"
timestamp "Finding and deleting duplicates in playlist \"$playlist\" by exact URI match:"
"$srcdir/spotify_duplicate_uri_in_playlist.sh" "$playlist_id" |
"$srcdir/spotify_delete_from_playlist.sh" "$playlist_id"
done

Loading…
Cancel
Save