aboutsummaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_rippy
diff options
context:
space:
mode:
authortwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
committertwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
commit2140ab51deed88e90eafebf9520fa5f9995dc7c9 (patch)
tree03cf1dcd2900495c1efb79aaa85f3254ecd5fb87 /private_dot_local/bin/executable_rippy
parentff8f50638e4b17a9d7cc88d2f0d9560b7effce39 (diff)
Migrate from stow
Diffstat (limited to 'private_dot_local/bin/executable_rippy')
-rw-r--r--private_dot_local/bin/executable_rippy35
1 files changed, 35 insertions, 0 deletions
diff --git a/private_dot_local/bin/executable_rippy b/private_dot_local/bin/executable_rippy
new file mode 100644
index 0000000..6b89d5a
--- /dev/null
+++ b/private_dot_local/bin/executable_rippy
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if [ "$1" = "-o" ]; then
+ shift
+ offset="$1"
+fi
+
+cd "$HOME"/media/music || exit
+
+abcde -po flac,mp3 || exit
+
+echo "Ripped successfully"
+
+dir="$(eza -rs created | head -n1)"
+new="../mp3-mirror/$dir-mp3"
+
+if [ -n "$offset" ]; then
+ for i in "$dir"/*; do
+ song_name="${i#*.}"
+ song_num="${i%%.*}"
+ song_num="${song_num##*/}"
+ song_num="${song_num#*0}"
+
+ new_fname="$(printf "%s/%02d.%s\n" "${i%%/*}" "$((song_num + offset + 1))" "$song_name")"
+ mv "$i" "$new_fname"
+ done
+fi
+
+
+sleep 1
+
+[ "$(mkdir ../mp3-mirror/"$new")" ] || printf "\e[0;33mmp3 directory already exists\nCopying files to existing directory\n\e[0m"
+mv -v "$dir"/*.mp3 "$new"
+
+printf "\e[0;32mmp3 mirror successful\e[0m\n"