Spring clean anyone? (free cleaning script)
-
Hi,
I found myself with the need to cleanup some of my roms, I had about 8000 and half didn't have any artwork. Because I'm building this ystem for my five year old son, he really needs to see the box art to know what he's playing and 8000 roms is way too many for him to deal with.
I've been keen to give Python a try for a while now, so I wrote this little script that loops through all the rom directories, then checks if an artwork image exists, if it doesn't you can opt to move those files to a backup directory, or permanently delete them.
This is literally my second ever Python script so I doubt it's perfect, but it serves a need that I have and I thought that I would share it with the awesome RetroPie community. You can get the script from here:
https://github.com/andywarburton/RetroPie-Tools/blob/master/remove-imageless-roms.py
Simply copy the file to your Raspberry Pi and run from the command line while Emulation Station isn't running (quit with F4 or from the menu) like so:
sudo python ./remove-imageless-roms.py
It'll then prompt you to "DELETE", "CLEAN" or "TEST".
I highly recommend you start with "TEST". It'll sweep your system, show you what can be cleaned and tell you how many roms you'll lose and how many will remain. Then, if you are feeling brave, repeat with "CLEAN" or "DELETE" (I recommend "CLEAN" unless you have balls of steel).
Anyone brave enough to give this a try? :-)
If you have any feedback, feel free to leave an issue on github (link above) or reply on here and I'll do what I can.
Next I want to create a similar script that does the inverse - deletes images that don't have a rom (to save you traversing all those creepy linux directories manually). Would love to hear any other ideas for utility scripts to help with cleaning up / maintenance (again feel free to post here or via github).
-
I do see an issue with things such as Dosbox and other non rom files
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.