diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-01-08 01:09:55 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-01-08 01:09:55 +0100 |
| commit | 1f0b8e1f999eb140aa7b63807dfce674d35a4814 (patch) | |
| tree | 498be47824d5b645c94dd140a27e64ea8042168d /bin/tag-music | |
| parent | a23b58c60540281e41dc73313f2c9598cf37a17f (diff) | |
| parent | 3ce48c4323f38d3b61a08e7e2add5543adabe5d7 (diff) | |
| download | dotfiles-1f0b8e1f999eb140aa7b63807dfce674d35a4814.tar.gz dotfiles-1f0b8e1f999eb140aa7b63807dfce674d35a4814.tar.bz2 dotfiles-1f0b8e1f999eb140aa7b63807dfce674d35a4814.zip | |
Merge branch 'master' into carbon
Diffstat (limited to 'bin/tag-music')
| -rwxr-xr-x | bin/tag-music | 38 |
1 files changed, 11 insertions, 27 deletions
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 |
