summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlshprung <lshprung@yahoo.com>2021-09-14 16:31:30 -0700
committerlshprung <lshprung@yahoo.com>2021-09-14 16:31:30 -0700
commitb24de062d156ae3f04773de55379e3277452f712 (patch)
tree216c1733a3bc9c01c2dd92a91ae7abd5a409dedd
parentb2b338da4d64c9752f37c25297bb726e4d3aa7bc (diff)
Remove illegal characters for generating file name
-rwxr-xr-xbuild_playlists.plx6
1 files changed, 5 insertions, 1 deletions
diff --git a/build_playlists.plx b/build_playlists.plx
index 3e43098..d860d7d 100755
--- a/build_playlists.plx
+++ b/build_playlists.plx
@@ -141,11 +141,15 @@ else {
$tag_hash{$tags_of_interest[$j]} = $db_output[$j];
}
+ # TODO break up by semicolon (signifying array of tag values)
# Determine output_file
$output_file = $output_pattern;
$output_file =~ s/[{]([^}]*)[}]/$tag_hash{$1}/g;
- # TODO remove illegal filename characters
+ # remove illegal filename characters, replace them with underscore
+ $output_file =~ s/[\/<>:"\\|?*]/_/g;
+ print "$output_file\n";
+
# Open the file for writing
open FH, ">> $output_file" or die $!;
# DEBUG