rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
2.05k stars 88 forks source link

[Feature] Switch Handler using titleid #350

Closed KillahB33 closed 11 months ago

KillahB33 commented 1 year ago

Is your feature request related to a problem? Please describe. Titleid is required for the shop program I am using so my files will always have it.

Describe the solution you'd like Look up the switch game by titleid present in the file name.

Describe alternatives you've considered Don't want to manually do it.

Additional context the json for titleids is here. https://github.com/blawar/titledb

gantoine commented 1 year ago

A couple questions:

KillahB33 commented 1 year ago

Sure!

gantoine commented 1 year ago

@zurdi15 I see two ways we can approach this, and I'd like your thoughts:

a) we include the latest version in the code and update it manually/each deploy b) we add an option for users to fetch/refetch the file right from github

Notes:

KillahB33 commented 1 year ago

If I may, as docker person I would suggest b. As you mention the file is pretty large, I think checking if the switch directory is present and then fetching the file (or how ever you decide) works best. Obviously that last piece is between yall. Apologies if I am overstepping here 😃

zurdi15 commented 1 year ago

Hmm very interesting thing. I think that indeed the best approach is the b) because I don't want to relegate on us the task to update it. It should be independant of RomM version, so letting users fetch and update the file when required (adding a new recent game or something like that) is the most balanced option.

  • Should we even be supporting systems that are still releasing new games (unlike PS2 OPL which is static)?

i think we should support living systems, RomM is maybe focused on retro but a lot of users have modern console emulators.

gantoine commented 1 year ago

Follow up question then: is this setting something that lives under general settings, like another tab where UI stuff is? Or in the switch library/gallery, since it's switch specific? Also if it's in the switch library, any ideas what it should look like?

zurdi15 commented 1 year ago

Very good question... I need to think a little bit about it. It could be under the system view, under the library section or under the settings section, but not sure right now what is the most intuitive/better place. What do you think?

And where would you like to see it @KillahB33

KillahB33 commented 1 year ago

I think the settings page that you guys have currently marked as coming soon makes sense. Again as a docker guy an environment would be enough for me but I think from a UX perspective the settings page makes sense.

zurdi15 commented 1 year ago

Yeah we need to think that some users are installing RomM with tipi or casaOS, so we should keep this kind of things outside of the base docker configuration.

Actually, I think that as this is related to a platform and the library itself, this should be placed maybe under the library section, in a config subsection. There we will have a platform selector for each platform with special files like this one with the switch or files like the ps2/opl case.

image

What do you think?

gantoine commented 1 year ago

Actually, I think that as this is related to a platform and the library itself, this should be placed maybe under the library section, in a config subsection.

I think that makes sense, and I assume we can re-use it for other platform-specific things (of which there will be more).

zurdi15 commented 1 year ago

I think that makes sense, and I assume we can re-use it for other platform-specific things (of which there will be more).

Yeah that's the point! We have an agreement then!

gantoine commented 1 year ago

Ok I've got this working (backend only) in a joint branch with redis-backed scheduled tasks (rescan library). Once the auth stuff is merged in and we release 2.0 we can get back to this. Right now adding UI elements would be too much refactoring since so much changed.

zurdi15 commented 1 year ago

Ok I've got this working (backend only) in a joint branch with redis-backed scheduled tasks (rescan library). Once the auth stuff is merged in and we release 2.0 we can get back to this. Right now adding UI elements would be too much refactoring since so much changed.

Cheers on that! Couldn't agree more

KillahB33 commented 1 year ago

Amazing guys!! Thank you for this!

zurdi15 commented 11 months ago

@KillahB33 titleDB support was added as a scheduled task for switch in the last v2.1.0 release!

KillahB33 commented 11 months ago

@zurdi15 is there anything I need to do to get it to work? I have some new files I added to that dir and they aren't getting pulled. sxs-the_legend_of_zelda_tears_of_thekingdom[0100F2C0115B6800][v196608].nsp for example

gantoine commented 11 months ago

Oh hmm yeah that won't work, can you paste a couple examples of file names for your switch games? I'll need to update the code.

KillahB33 commented 11 months ago

Yeah of course. The naming style isn't consist, but the title id being present is. This one gets picked up fine because of the standard name lookup works. Super Mario Bros. Wonder [010015100B514000][v0][Base].xci This one does not, it's super smash bros, v0 means it's the base game. v-ssbu[01006A800016E000][v0].xci

I am not sure the progress is on patches and DLC but the v would only be a concern there. I realize my first example of zelda was a patch.

gantoine commented 11 months ago

@KillahB33 Figured out what's going on, your file names use the programID, not the titleID. You can find a list of programIDs here, where you'll find your IDs in the list. We currently don't support scanning by programID.

There's a source with an XML file available here which we could likely use.

KillahB33 commented 11 months ago

From what I am seeing program id and titleid seem to be the same thing.

01003BC0000A0000 brings up splatoon 2, it's also listed as a title id in you file there.

gantoine commented 11 months ago

Ah it's listed as theid field, not the key used to group the games. Good news is I can patch a check for that in!

"70010000000529": {
        "id": "01003BC0000A0000",
        "intro": "Ink-splatting action is back and fresher than ever",
        ...
}