summaryrefslogtreecommitdiff
path: root/build_playlists.plx
diff options
context:
space:
mode:
Diffstat (limited to 'build_playlists.plx')
-rwxr-xr-xbuild_playlists.plx9
1 files changed, 5 insertions, 4 deletions
diff --git a/build_playlists.plx b/build_playlists.plx
index d860d7d..9a41942 100755
--- a/build_playlists.plx
+++ b/build_playlists.plx
@@ -139,6 +139,11 @@ else {
@db_output = flatten_array(db_cmd($dbh, "SELECT $statement FROM $table_name WHERE ID=$i;"));
for my $j (0..scalar(@db_output)-1){
$tag_hash{$tags_of_interest[$j]} = $db_output[$j];
+
+ # remove illegal filename characters, replace them with underscore
+ if (!($tags_of_interest[$j] eq "PATH")){
+ $tag_hash{$tags_of_interest[$j]} =~ s/[\/<>:"\\|?*]/_/g;
+ }
}
# TODO break up by semicolon (signifying array of tag values)
@@ -146,10 +151,6 @@ else {
$output_file = $output_pattern;
$output_file =~ s/[{]([^}]*)[}]/$tag_hash{$1}/g;
- # 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