Every one of my music folders are set up like Artist > Year Album >
Track 01.flac
Track 02.flac
Track 03.flac
folder.jpg, jpeg, png, etc
And what I need to do is if folder.* is available.
if [ -f folder.* ]; then
Run this command to set smaller size without replacing the original photo.
for small in folder.*
convert $small -resize 1000x1000 temp$small
Then run these commands on every file to automatically add the smaller sized cover to each audio file's tagging.
ffmpeg -i TRACK.flac -i SMALLFOLDER.* -map a -map 1:v -disposition:v attached_pic -metadata:s:v comment="Cover (Front)" -codec copy TRACKWITHART.flac
&& rm TRACK.flac
&& mv TRACKWITHART.flac TRACK.flac
&& rm temp$small
Last little bit there is me cleaning up. I'm having trouble piping commands into one another with this and not the most experienced with that sort of thing.
And also, if it's not available like above, will need to extract it from the first audio file by finding it.
else
find . -name "*.flac" -print -quit
And extracting it with this command.
ffmpeg -i TRACK.flac -vf scale=1000:1000 -an FOLDER.png
Then run the other commands above.
Now I don't know if anyone is familiar with FFmpeg but it's actually kind of nightmare because it's not necessarily for audio tagging but I don't know anything else to handle this kind of automated album art task in the terminal. If anyone can point me more in the right direction with a better CLI utility, that'd be awesome or just help with this bash scripting. You can see I'm fairly familiar with the terminal and getting some things done by searching the web but putting them altogether in a bash script is very difficult for me to understand, if anyone has some links for specifically this, that would be much appreciated.