alucryd / oxyromon

Rusty ROM OrgaNizer
Other
110 stars 13 forks source link

Per set custom rom path configuration #128

Closed graphixillusion closed 3 months ago

graphixillusion commented 3 months ago

Hi there. As the title says, is it possible to customize the rom path for a single dat file? I would like to override the auto choosen name when importing the roms. This option should be useful expecially for the no-intro sets which has systems with multiple version of the same dat (decrypted, encrypted, etc..). Maybe strip only the date/time from the dat name and leaving all the rest when creating the folder? I think we should have thess both...

alucryd commented 3 months ago

There's already an option that seems to achieve what you want: GROUP_SUBSYSTEMS. When set to false systems that have variants will be kept separate, the folder name will be the full DAT name. It is set to true by default, and in that case anything that's in parentheses in the DAT name is stripped.

graphixillusion commented 3 months ago

Oh ok perfect, thank you for let me know this. Anyway an option to set a custom rompath per dat should be useful too imho.

alucryd commented 3 months ago

Sure, that's not too hard to implement, I'll add a flag to override the system name, will only work when importing a single dat of course.

alucryd commented 3 months ago

Implemented in https://github.com/alucryd/oxyromon/commit/3556cb8d5604ff5a5c9090938ad4eafbdfbc3866 :)

graphixillusion commented 3 months ago

Thank you for super fast implementation. I think it shoud be usefull the option to change it after import too. Something like config -s -dp (or --dat-path), invoke dat selection, then ask for the new path.

alucryd commented 3 months ago

I'd like to keep the config command for global configuration only.

Would prefer renaming with a subsequent call to import-dats, but that'd be a bit more involved. While changing the system name from the default one after the fact would be easy (because I can match the system from the name in the DAT), renaming a system that already has a custom name will be impossible without prompting the user. The only easy way I can think of is to add a new column in the system table so I can keep both the original name and the custom name in the database.

Also import-dats will not rename any actual file or directory, that would be the job of the sort-roms command.

alucryd commented 3 months ago

Done :) https://github.com/alucryd/oxyromon/commit/b7317a9fe85eddb9574a3ee37e9202d5972b1961

You can simply reimport a DAT to set a custom name after the fact. I have yet to test the feature locally, but reimporting the DAT without specifying a custom name will revert to the default name so you can go back and forth (will write a unit test for this tomorrow).

BTW a custom name bypasses the GROUP_SUBSYSTEMS setting, so any parentheses will be kept even if it is set to true.

alucryd commented 3 months ago

Well had time to write a unit test, reverting works, just make sure to pass -f when reimporting the same DAT, either to set a custom name or to revert, as DATs with the same date are skipped without that flag.