aboutsummaryrefslogtreecommitdiff
path: root/scripts/music/tag-bulk.sh
blob: bd93205fdc2aea4c046f98619e1de5b618bb412c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash

artist=$1;
album=$2;

ext=${3:-'opus'};

file=${4:-'taginfo'};

total=$(cat $file | wc -l);

cat $file | while read n song; do
  song_file="$song.$ext";
  if [[ -f "$song_file" ]]; then
    ~/scripts/music/tag.sh \
      -a "$artist" \
      -A "$album" \
      -t "$song" \
      -n "$n" \
      -N "$total" \
      "$song_file";
  else 
    echo "File $song_file not found";
  fi;
done;