From cf6bd83b9bc3f739c755516706d6702dc2567550 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 2 Oct 2020 18:55:35 +0200 Subject: Added keyrepeat, ti ignore node_modules --- bin/tag-music | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'bin') diff --git a/bin/tag-music b/bin/tag-music index 17d6aac..e801132 100755 --- a/bin/tag-music +++ b/bin/tag-music @@ -16,33 +16,17 @@ do for song_file in "$album_dir"/* do [ ! -f "$song_file" ] && continue - song="$(basename "$song_file" | cut -d '.' -f 1)" - # echo "$artist" - # echo "$album" - # echo "$song" - case "$song_file" in - *.ogg) - ;; - *.opus) - echo "OPUS: $song_file" - echo "Title=$song -Artist=$artist -Album=$album -Track= -Total= -Date= -Genre= -Comment=" | opustags -i -S "$song_file" - ;; - *.mp3) - id3tag --artist "$artist" --album "$album" --song "$song" "$songfile" - ;; - *.m4a) - id3tag --artist "$artist" --album "$album" --song "$song" "$songfile" - ;; - *) - ;; - esac + song="$(basename "$song_file" | rev | cut -d '.' -f 2- | rev)" + # echo $song_file + track=0 + if expr "$song" : "[0-9][0-9]*\-.*" > /dev/null + then + track="$(echo "$song" | cut -d '-' -f 1)" + song="$(echo "$song" | cut -d '-' -f 2-)" + fi + # echo $track $song + echo $song_file + taffy --artist "$artist" --album "$album" --title "$song" --track "$track" "$song_file" done done done -- cgit