a gamelist.xml cleaner tool
-
This is really cool! Good work, guys!
-
Suggestion:
Script should clean up all related items to the file (As @Sano has suggested with his images deletion).
Change default behavior to:
- Copy gamelist.xml to gameslist<DATE>.xml
- Modify the gamelist.xml file directly
- Move all images/video's into a sub-folder "Unused"
New Option: -r (remove)
Removes any files in the Unused folder (If supplied during the initial scan, does not move files to Unused, just deletes them)The default behavior would mean if you have 15 systems, you have no work to do, but you still have the "backup" file.
The new option means if you are confident or don't care, after running the cleanup script a user would have nothing to do.Thoughts:
- Do people cross link images/movies for 1 system to the same game in another system or folder? If so, the script would need to check for ANY/ALL occurrences or references to the image/movie.
- If a user provides this new -r option, should a backup of gameslist.xml be created at all?
- Perhaps create multiple other shell scripts for the separate functions, and a master script that calls them.
A) gamelist-cleanup-master.sh - orchestrates the cleanup process by calling all sub-scripts and passing in parameters
B) gamelist-cleaner.sh - Does what is has always done.
C) downloaded-images-cleaner.sh - Would remove un-linked images and movies if no reference is found in any of the XML files
-
@kaltinril oh, I forgot this tool on my TODO list. :-)
Will try to improve it next week. I'm currently pretty busy.
-
@meleu I ended up manually going through my SNES folder and deleting the unused images. Took a few days, I'm gonna go ahead and patiently wait for you to do the other ones haha. It's not a space issue or anything, I'm just a perfectionist and don't want any unnecessary files on my machine.
Thanks for all the other tools, and really no rush. Real life takes precedent to our Pi's :)
-
Going to clone and edit it and then send a pull request.
You can accept whatever you want, or reject it all :)
-
I've got the -r working. I also added -a for "all" so that I can just type this:
./gamelist-cleaner.sh -a -rand it cleaned up all folders and replaces the gamelist.xml instead of creating the -clean version.
https://github.com/kaltinril/share
I want to do some more testing before I submit a pull request.
-
@kaltinril you can submit a PR and then we can discuss about the code on github. ;-)
-
@meleu Submitted.
-
Is this ready to be used?
-
@thewinterdojer I didn't tested but I merged his script. You can find it here:
https://raw.githubusercontent.com/meleu/share/master/images-cleaner.sh@Kaltinril added a
-t
option to just test and not actually delete anything. It's a cool feature. -
@meleu Awesome. I will give this a try when I get home. Thanks a bunch!
-
This worked perfectly, thank you. I deleted 826 images across 6 systems, all duplicates :)
-
The gamelist-cleaner.sh by @Kaltinril seems to be the newer one. Maybe this could be mergeded into the one by @meleu?
Is the images-cleaner.sh by @meleu already usable?
-
I an trying to use this to clean up the images of games that i have removed and all i get is errors. the comman im using is
./images-cleaner.sh -t -g /home/pi/RetroPie/roms/nes -i /home/pi/RetroPie/roms/nes/images
when it ends all i get is error could not find gamelist for system but i know the gamelist.xml is in that folder and the images are in the images folder.
-
@vodkanakas Are you sure your gamelist files are in /home/pi/RetroPie/roms/nes ?
Default is /home/pi/.emulationstation/gamelists/nes (that's the default for the script, too).
Edit : BTW if I remember, the script loops through the systems.
Have you just tried to launch it with the default folders ? :./images-cleaner.sh -t
-
@sano yes seelphs scraper has an option to use the Rom folder for the gamelists and images so that's why I know they are there. It accesses the images folder just not the gamelist.xml
Edit: If i try just ./images-cleaner.sh -t i get a no such file or directory
-
I tried running the
./images-cleaner.sh -t
containing the code that @meleu linked to here, after removing a bunch of roms from different system folders via SSH, but the script didn't report anything to delete.I would suppose it both deleted the redundant artwork as well as cleaning up the gamelist files, right?
Does this script not work if roms are placed on USB? Art+gamelists are placed under emulationstation/gamelists and /downloaded_images
-
@andershp according to the
--help
you can specify an arbitrary directory with--images
. Try it ;) -
@meleu the images are in the default place - it's the ROMs that are on USB..
-
@meleu I've just been through and cleaned all my gamelist.xml files - congrats for creating such a time-saving tool!
However, I've just noticed that (although it says the entry is removed from the .xml file during processing) any entry with & in the name is not removed from the .xml file.
Is there any way around this?
Cheers.
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.