RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Spring clean anyone? (free cleaning script)

    Scheduled Pinned Locked Moved Projects and Themes
    2 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      schmulkfuster
      last edited by

      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).

      1 Reply Last reply Reply Quote 2
      • Drakaen391D
        Drakaen391
        last edited by

        I do see an issue with things such as Dosbox and other non rom files

        RPi B & RPi 3B OC (Now Raspberry pi 4b 8gb)
        Retropie (Latest Stable)
        PiBox with Wind Tunnel Cooling System

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.