dots

my dotfiles
git clone https://git.awy.one/dots
Log | Files | Refs | Submodules | README | LICENSE

check_lyrics (674B) - View raw


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

MUSIC_DIR="${1:-.}"

# Check FLAC files for matching lyrics
fd --glob "*.flac" -t f "$MUSIC_DIR" | while IFS= read -r flac_file; do
  base_name="${flac_file%.flac}"
  lyrics_file="${base_name}.lrc"
  if [ ! -f "$lyrics_file" ]; then
    echo "Mismatch: $(basename "$flac_file" .flac) exists, but $(basename "$lyrics_file") is missing"
  fi
done

# Check for orphaned lyrics files
fd --glob "*.lrc" -t f "$MUSIC_DIR" | while IFS= read -r lyrics_file; do
  base_name="${lyrics_file%.lrc}"
  flac_file="${base_name}.flac"
  if [ ! -f "$flac_file" ]; then
    echo "Orphaned: $(basename "$lyrics_file" .lrc) exists, but $(basename "$flac_file") is missing"
  fi
done