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

Kernel, Main, Utilities & Apps, Misc Devices
amoore2600
Posts: 2
Joined: Sun May 24, 2020 6:46 pm

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

Unread post 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
Fallon
Posts: 31
Joined: Mon May 25, 2020 1:48 am

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

Unread post by Fallon »

Really useful. Thanks!
Locutus73
Posts: 46
Joined: Mon May 25, 2020 9:55 am

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

Unread post by Locutus73 »

Cool!

Thank you.

Locutus73
User avatar
NML32
Posts: 127
Joined: Sun May 24, 2020 6:57 pm

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

Unread post by NML32 »

I'm not familiar with symlinks, so sorry for the ignorant question.
Is this easy to undo?
User avatar
LamerDeluxe
Posts: 55
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 1 time

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

Unread post 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.
User avatar
lomdar67
Posts: 137
Joined: Sun May 24, 2020 8:27 pm

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

Unread post 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?
We raise hopes here...until they're old enough to fend for themselves.
--Mike Callahan
Fallon
Posts: 31
Joined: Mon May 25, 2020 1:48 am

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

Unread post 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
corysnyder28
Posts: 1
Joined: Sun May 24, 2020 9:01 pm

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

Unread post 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?
Fallon
Posts: 31
Joined: Mon May 25, 2020 1:48 am

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

Unread post 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.
dukrous
Posts: 3
Joined: Sun May 24, 2020 7:07 pm

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

Unread post 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
netbeui
Posts: 17
Joined: Fri Jul 31, 2020 5:04 am

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

Unread post 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!
Post Reply