scripts

Scripts
git clone git://git.wimdupont.com/scripts.git
Log | Files | Refs | LICENSE

commit 43784dd4f186bc85421c3c6de7c4e12c83a90adc
parent 8e19e9e71fe4fc3f6c5f4a4ba1cd7b42edfa22d1
Author: Wim Dupont <wim@wimdupont.com>
Date:   Tue, 20 Feb 2024 19:18:38 +0100

declare r eagerness fix

Diffstat:
Mbin/ytd-album | 23+++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/bin/ytd-album b/bin/ytd-album @@ -77,26 +77,25 @@ for f in "$DIR"/*; do songname=$(echo "$f" | sed 's/.*\///g' | sed 's/.mp3//g') - readonly TRACK=$(echo $songname | cut -d ' ' -f 1) - readonly TITLE=$(echo $songname | sed "s/$TRACK - //g") + track=$(echo $songname | cut -d ' ' -f 1) + title=$(echo $songname | sed "s/$track - //g") - readonly OLDNAME=$songname + oldname=$songname - echo "Type song name for : ${TITLE}" + echo "Type song name for : ${title}" echo "Enter/Return to keep as is." - read NEWNAME - readonly NEWNAME + read newname - if [[ ! -z $NEWNAME ]]; then - songname=$NEWNAME; + if [[ ! -z $newname ]]; then + songname=$newname; - echo $OLDNAME to $songname + echo $oldname to $songname - mv "$DIR/$OLDNAME.mp3" "$DIR/$TRACK - $songname.mp3" + mv "$DIR/$oldname.mp3" "$DIR/$track - $songname.mp3" - id3 -t "$songname" -a "$BAND" -l "$ALBUM" -y "$YEAR" -n $TRACK -g "$GENRE" "$DIR/$TRACK - $songname.mp3" + id3 -t "$songname" -a "$BAND" -l "$ALBUM" -y "$YEAR" -n $track -g "$GENRE" "$DIR/$track - $songname.mp3" else - id3 -t "$TITLE" -a "$BAND" -l "$ALBUM" -y "$YEAR" -n "$TRACK" -g "$GENRE" "$DIR/$songname.mp3" + id3 -t "$title" -a "$BAND" -l "$ALBUM" -y "$YEAR" -n "$track" -g "$GENRE" "$DIR/$songname.mp3" fi done