fix import_music.sh, artist images still broken

main
Gabe Farrell 7 months ago
parent 712373e582
commit 1f063392be

@ -97,8 +97,15 @@ done
# Also move/copy associated image files (cover art & artist images)
find "$IMPORT_DIR" -type f \( -iname "*.jpg" -o -iname "*.png" \) | while read -r img_file; do
dir_path=$(dirname "$img_file")
artist=$(metaflac --show-tag=ALBUMARTIST "$dir_path"/*.flac 2>/dev/null | head -n1 | sed 's/^ALBUMARTIST=//')
album=$(metaflac --show-tag=ALBUM "$dir_path"/*.flac 2>/dev/null | head -n1 | sed 's/^ALBUM=//')
first_flac=$(find "$dir_path" -maxdepth 1 -type f -iname "*.flac" | head -n 1)
if [[ -z "$first_flac" ]]; then
echo "No FLAC file found in $dir_path to extract metadata from. Skipping image: $img_file"
continue
fi
artist=$(metaflac --show-tag=ALBUMARTIST "$first_flac" | sed 's/^ALBUMARTIST=//')
album=$(metaflac --show-tag=ALBUM "$first_flac" | sed 's/^ALBUM=//')
resolved_artist="$artist"
resolved_album="$album"
@ -120,4 +127,3 @@ find "$IMPORT_DIR" -type f \( -iname "*.jpg" -o -iname "*.png" \) | while read -
done
echo "Import completed."

Loading…
Cancel
Save