aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-14 09:11:20 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-14 09:11:20 +0200
commit2a8eaf57d0a8090ac10fe011e527774e484c96f9 (patch)
tree6831362b97e5e665f8044b7f8f6884adaf742554
parent0459e513045d3de259c5f2068718f00252a8abab (diff)
downloaddotfiles-2a8eaf57d0a8090ac10fe011e527774e484c96f9.tar.gz
dotfiles-2a8eaf57d0a8090ac10fe011e527774e484c96f9.tar.bz2
dotfiles-2a8eaf57d0a8090ac10fe011e527774e484c96f9.zip
Added tag-music script
-rwxr-xr-xbin/tag-music48
1 files changed, 48 insertions, 0 deletions
diff --git a/bin/tag-music b/bin/tag-music
new file mode 100755
index 0000000..17d6aac
--- /dev/null
+++ b/bin/tag-music
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+music_dir="$HOME/Music"
+
+for artist_dir in "$music_dir"/*
+do
+ [ ! -d "$artist_dir" ] && continue
+ artist="$(basename "$artist_dir")"
+ [ "$artist" = backup ] && continue
+
+ for album_dir in "$artist_dir"/*
+ do
+ album="$(basename "$album_dir")"
+ [ ! -d "$album_dir" ] && continue
+
+ 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
+ done
+ done
+done