Skip to content

Instantly share code, notes, and snippets.

@kini
Created December 8, 2013 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kini/7853878 to your computer and use it in GitHub Desktop.
Save kini/7853878 to your computer and use it in GitHub Desktop.
A helper script for uploading cover art sets to the Cover Art Archive on musicbrainz, in combination with @96187 's cover-art-bot tool.
#!/bin/bash
########################################################################
# A small script to help upload cover art sets to CAA, for example
# from VGMDB. Put this script in a staging directory, which will
# contain a subdirectory for each release you will be adding cover
# art sets for. Then copy or download all the cover art into the
# staging directory and run this script with [a URL ending in] a
# release MBID as an argument.
shopt -s nullglob
if [[ -z "$1" ]] ; then
echo "Error: Please supply a release MBID or URL as an argument."
exit 1
fi
MBID=$(grep -o '[^/ ]*$' <<<"$1")
mkdir -p $MBID
if [[ -e "$MBID/datafile" ]] ; then
mv $MBID/datafile $MBID/datafile.old
fi
for X in *.{jpg,png,gif,JPG,PNG,GIF} ; do
mv "$X" $MBID
done
cd $MBID
for X in *.{jpg,png,gif,JPG,PNG,GIF} ; do
echo -e "$MBID\t$X\t" >> datafile
done
echo "Created $MBID/datafile . Please add a type at the end of each line,"
echo "then use the datafile with nikki's cover art bot (see"
echo "https://github.com/96187/cover-art-bot )."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment