From c7a7dee603ffbb215294121900100d13f029808d Mon Sep 17 00:00:00 2001 From: fabs Date: Sat, 29 Jan 2022 18:18:12 +0100 Subject: [PATCH] replace_slash --- music_tagmove_lib | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/music_tagmove_lib b/music_tagmove_lib index 6ee6d06..5f5fa38 100644 --- a/music_tagmove_lib +++ b/music_tagmove_lib @@ -273,13 +273,14 @@ function cmd_wrap { } function tagmove_single { + function _replace_slash { tr '/' '-' <<<"$1"; } local_errf= file_name="$1" - artist=$(read_tag artist "$file_name") - date=$(read_tag date "$file_name") - album=$(read_tag album "$file_name") - track=$(read_tag track "$file_name") - title=$(read_tag title "$file_name") + artist=$(_replace_slash "$(read_tag artist "$file_name")") + date=$( _replace_slash "$(read_tag date "$file_name")") + album=$( _replace_slash "$(read_tag album "$file_name")") + track=$( _replace_slash "$(read_tag track "$file_name")") + title=$( _replace_slash "$(read_tag title "$file_name")") if [[ -n $local_errf ]]; then error "Error reading tags for file \"$file_name\"" @@ -297,7 +298,7 @@ function tagmove_single { # Set fixed width for track number track=$(printf "%02d" $(cut -d'/' -f1 <<<"${track#0}")) - + eval "dest_directory=\"$DIRECTORY_FORMAT\"" eval "dest_file=\"$FILE_FORMAT\""