Page 1 of 1

Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 2:02 am
by amoore2600
A Simple scripts to automate organizing MiSTers _Arcade directory based on you MRA files.

Instructions:

Download the update_arcade-organizer.sh to the Scripts directory and run.

This script looks at what MRA files you have and the information in them to organize MiSTer's _Arcade directory.

If the XLM tags for Year, Manufacturer, and Category are included in the MRA file, this script will create an "_Organized" Directory in "_Arcade" and will create the following sub-directories with soft sysmlinks to organize it:

_Organized
├── _1 A-E
├── _1 F-K
├── _1 L-Q
├── _1 R-T
├── _1 U-Z
├── _2 Year
├── _3 Manufacturer
└── _4 Category
These scripts DO NOT DUPLICATE any cores or mra files, only soft symlinks are used.

THESE SYMLINKS ONLY WORK ON MISTER! IF YOU MOUNT YOUR SD CARD OUTSIDE OF MISTER THESE SYMLINKS WILL NOT WORK.

THIS SCRIP USES A DEFAULT LOCATION FOR _Arcade at /media/fat/_Arcade

AND

A DEFAULT LOCATION FOR _Organized at /media/fat/_Arcade/_Organized

If your _Arcade Directory is in a diffrent location you MUST use a /media/fat/Scripts/update_arcade-organizer.ini file

If your not using the default locations for _Arcade and _Organized you must add their locations in /media/fat/Scripts/update_arcade-organizer.ini

Q: How can I set my own custom locations for MRA and _Organized Directories?

A: A /media/fat/Scripts/update_arcade-organizer.ini file may be used to set custom location for your MRA files (Scans recursivly) and _Organized files. Add the following line to the ini file to set a directory for MRA files: MRADIR=/top/path/to/mra/files/_Arcade Add the following line to the ini file to set a directory for Organized files: ORGDIR=/path/to/organized/files/_Organized

Q:Will this script over write files I already have?

A: NO, This script will not clober files you already have.

Q: What If I get new MRA/Core files?

A: You need to re-run the script to have them included in the Organized files.

You should back up your _Arcade directory before running this script.

USE AT YOUR OWN RISK - THIS COMES WITHOUT WARRANTE AND MAY NEUTER EVERYTHING.


https://github.com/MAME-GETTER/_arcade-organizer

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 5:37 am
by Fallon
Really useful. Thanks!

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 7:17 am
by Locutus73
Cool!

Thank you.

Locutus73

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 12:02 pm
by NML32
I'm not familiar with symlinks, so sorry for the ignorant question.
Is this easy to undo?

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 12:07 pm
by LamerDeluxe
NML32 wrote: Fri May 29, 2020 12:02 pm I'm not familiar with symlinks, so sorry for the ignorant question.
Is this easy to undo?
Just delete the _Organized folder I would think.

This script is a really great idea.

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 12:14 pm
by lomdar67
Sounds cool.Thanks a lot.

What happens if an mra is missing any or all of the XLM tags for Year, Manufacturer, and Category?

Due to the RetroDriven MiSTerMAME script I assume that there are a lot of people out there that have the following (or a very similar) structure for their mra files:

_Arcade
├_alternatives
├_Unofficial
├ ├_CPS1
├ ├_Alternatives
├_Jotego
├ ├_Alternatives
├_Sega System 1
├ ├_Alternatives

All these sub directories contain mra files and/or sub directories. Will this kind of structure also work?

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Fri May 29, 2020 1:07 pm
by Fallon
lomdar67 wrote: Fri May 29, 2020 12:14 pm What happens if an mra is missing any or all of the XLM tags for Year, Manufacturer, and Category?
I'd imagine this will result in files not being moved to those tag categories if the script can't access the data, but moved to the alphabetic sorted folders.

I've been working on a similar Python script and noticed several MRA files missing the data you mentioned, and also MRA file names that did not match the MAME xml <description> tags, where most of the MRA file names seem to come from. You could add the data tags to the MRA files, or physically move the files yourself

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Sun May 31, 2020 6:59 pm
by corysnyder28
Thanks amoore2600 for the script!

When I run the script, I get a blank screen:

https://imgur.com/bZtGdfR

My MRA files are all in /media/fat/_Arcade, with everything working as it should.

Any ideas what might be causing this?

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Sun May 31, 2020 11:02 pm
by Fallon
corysnyder28 wrote: Sun May 31, 2020 6:59 pm Thanks amoore2600 for the script!

When I run the script, I get a blank screen
Seems like you didn’t select the correct script? There are two scripts to install, one to organize and one to update the script, which you seemed to select.

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Sun Jun 14, 2020 5:00 pm
by dukrous
This script results in a folder that takes up an unusually large amount of space. From a fresh install, the _Organized folder eats up 416 MB of space, which is more than double the space all the cores use up. I wrote up an issue about it here: https://github.com/MAME-GETTER/_arcade- ... r/issues/6

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Wed Sep 16, 2020 4:41 pm
by netbeui
It would be great if we had 2 additional folders under Organized; one for Vertical orientation games and one for Horizontal orientation games. If that can't be added to this script can I manually do this myself by creating a Vertical and Horizontal folder myself and manually copying mra files into those folders? Not sure how to create symbolic links, if that's the preferred method please let me know how I go about that. Thanks!

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Mon Aug 23, 2021 7:25 am
by filthyromance
dukrous wrote: Sun Jun 14, 2020 5:00 pm This script results in a folder that takes up an unusually large amount of space. From a fresh install, the _Organized folder eats up 416 MB of space, which is more than double the space all the cores use up. I wrote up an issue about it here: https://github.com/MAME-GETTER/_arcade- ... r/issues/6
What is the state of play with this? The extra folders are very useful I think, and would love something like this for Neo Geo. anyone done the same for console cores? And does it reduce storage capacity?

Re: Organize MiSTer's _Arcade directory based on MRA Metadata with symlinks

Posted: Mon Aug 23, 2021 9:30 am
by Stupid Dufus
Looks like dukrous' commit to change the block size from 128 KB to 32 KB was accepted on June 18, 2020 https://github.com/MiSTer-devel/SD-Inst ... Ter/pull/3

I just did a check, and my _Organized folder is 91 MB. Contains all the official Arcade cores along with jotego's (and his betas).

So yes, it does reduce storage capacity, but it's less than 100 MB for some organization of the arcade cores.

Haven't seen anything like this for console cores, but I think some people might have their own directory structure for their console games.