2024-07-29, 05:16 AM
I made a quick bash script to put all of the artwork into their own folder, then refreshed my library. This worked, and the new posters from themoviedb look more uniform, since a lot of the poster files I was saving were theatrical release posters with all the credits.
I'm sure I could easily figure out a way to move them back if I should ever want to, so it's not a big deal
Code:
#!/bin/bash
function yes () {
find . -type f \( -iname *jpeg -o -iname *.jpg -o -iname *.png -o -iname *.webp -o -iname *.avif \) ! -path '*/artworks/*' -exec sh -c '
for src; do
dest=${src%/*}/artworks
mkdir -p "$dest" && mv "$src" "$dest"
done' sh {} +;
}
find . -type f \( -iname *jpeg -o -iname *.jpg -o -iname *.png -o -iname *.webp -o -iname *.avif \) ! -path '*/artworks/*' -exec sh -c '
for src; do
dest=${src%/*}/artworks
echo mkdir -p "$dest" && echo mv "$src" "$dest"
done' sh {} +
read -p "Does this look right? (y or n) " yn
case $yn in
y ) yes;;
n ) echo Try again...;
exit;;
* ) echo invalid response;
exit 1;;
esac
exit
I'm sure I could easily figure out a way to move them back if I should ever want to, so it's not a big deal