Skip to content

Commit dfd9f26

Browse files
committed
updated spotify_playlist_to_filename.sh
1 parent a0e9946 commit dfd9f26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spotify/spotify_playlist_to_filename.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ sanitize_filename() {
5353
perl -CS -Mutf8 -p -e '
5454
s{[\x00-\x09\x0B-\x1F\x7F]}{_}g; # control chars except \n
5555
s{[^\p{Print}\p{Emoji}\n]}{_}g; # non-printable, non-emoji, keep \n
56+
s/\s+$//; # no trailing spaces, happens in emoji suffix playlists
5657
' |
5758
if is_windows; then
5859
perl -CS -Mutf8 -p -e '
5960
s{[\\/:*?"<>|]}{_}g; # Windows-invalid filename characters
60-
s/[ .]+$//; # trailing space or dot (Windows)
61+
s/[\s.]+$//; # trailing space or dot not valid on Windows
6162
'
6263
else
6364
cat

0 commit comments

Comments
 (0)