summaryrefslogtreecommitdiff
path: root/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album
diff options
context:
space:
mode:
authorbdunahu <bdunahu@operationnull.com>2026-01-04 13:13:39 -0700
committerbdunahu <bdunahu@operationnull.com>2026-01-04 13:13:39 -0700
commitc2b706ff2f3aa42d58a03febad1d1b8f8d5a1142 (patch)
treed6786f531f02717472abdc992cc6c6ef81e660b3 /guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album
parentc4ca05231236c7e9bdf5304275eadde954acf588 (diff)
remove unnecessary nested guix dir
Diffstat (limited to 'guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album')
-rwxr-xr-xguix/kolwynia/home/bdunahu/files/.local/bin/fetch-album38
1 files changed, 0 insertions, 38 deletions
diff --git a/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album b/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album
deleted file mode 100755
index 3885f88..0000000
--- a/guix/kolwynia/home/bdunahu/files/.local/bin/fetch-album
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-err() { echo "Usage:
- rename [OPTIONS]
-Options:
- -d: delimiter
- -a: artist/author
- -A: album/book title
- -y: year of publication
-You will be prompted for these fields if not given." && exit 1 ;}
-
-[ "$PWD" = "${HOME}/ik/tmp" ] || { echo "Unsafe directory!" && exit 1 ;}
-
-while getopts "d:a:A:y:" o; do case "${o}" in
- d) delimiter="${OPTARG}" ;;
- a) artist="${OPTARG}" ;;
- A) album="${OPTARG}" ;;
- y) year="${OPTARG}" ;;
- *) printf "Invalid option: -%s\\n" "$OPTARG" && err ;;
- esac done
-files=(*)
-echo "Reference: ${files[0]}"
-[ -z "$delimiter" ] && echo "What are the delimiters for these files?" && read -r delimiter
-echo "Which index contains the track title? (Starting from 1)" && read -r index
-
-[ -z "$artist" ] && echo 'Enter an artist.' && read -r artist
-[ -z "$album" ] && echo 'Enter an album.' && read -r album
-[ -z "$year" ] && echo 'Enter a year.' && read -r year
-
-for file in *;
-do
- extension=$(echo $file | awk -F "." '{print $NF}')
- title=$(echo $file | awk -F "${delimiter}" "{print \$${index}}" |
- sed -re 's/^[[:blank:]]+|[[:blank:]]+$//g' -e 's/[[:blank:]]+/ /g')
- new_file="${title}_${artist}_${album}_${year}.${extension}"
- mv "./$file" "./$new_file"
- tag-media -a "${artist}" -t "${title}" -A "${album}" -d "${year}" "${new_file}"
-done