Skip to content

Commit 3740cf3

Browse files
committed
updated spotify_playlist_id_to_name.sh
1 parent 810a423 commit 3740cf3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spotify/spotify_playlist_id_to_name.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ playlist_id_to_name(){
5151
shift || :
5252
# if it's not a playlist id, scan all playlists and take the ID of the first matching playlist name
5353
if is_spotify_playlist_id "$playlist_id"; then
54-
playlist_name="$("$srcdir/spotify_api.sh" "/v1/playlists/$playlist_id" "$@" |
55-
jq -r '.name' || :)"
54+
playlist_name="$(
55+
"$srcdir/spotify_api.sh" "/v1/playlists/$playlist_id" "$@" |
56+
jq -r '.name' |
57+
sed 's/[[:space:]]*$//' || :
58+
)"
5659
# it turns out a playlist name can be blank :-/
5760
#if is_blank "$playlist_name" || [ "$playlist_name" = null ]; then
5861
if is_blank "$playlist_name"; then

0 commit comments

Comments
 (0)