valters-tomsons / Spectabis

A modern PCSX2 Frontend.
https://spectabis.github.io/
GNU General Public License v3.0
114 stars 19 forks source link

Suggestion: Better game name detection #41

Closed HalfOfAKebab closed 3 years ago

HalfOfAKebab commented 5 years ago

I'm not sure how Spectabis currently detects game names, but it doesn't work very well. This makes it annoying to add bulk games to the library, because you'll have to manually add artwork to each and every one of them, which can be really time-consuming.

Even some basic improvements would be a massive help. For example, my games are named like this: "Burnout 3 Takedown [SLUS-21050] [1.00].iso.gz". I think even just detecting game serials in filenames would be a huge help.

For the heathens who don't compress their ISOs, that would be easy, since you could just checksum the ISO to determine the game with 100% accuracy.

Detecting the game name if the filename doesn't contain the game serial might be a bit trickier, since there are multiple ways of formatting game names. For example, some people might call it "Burnout 3 - Takedown". Maybe this could be worked around by removing all special characters, spaces, etc. and then comparing that end result to a database of files which has an actual, standardised game name to look up.

For a rough example of what I mean, take these game filenames...:

...would be stripped of special characters, and the end result would be "marcecksgettingupcontentsunderpressure" for all three of those filenames. Then, there would be a big local file with a database which tells the program to convert "marcecksgettingupcontentsunderpressure" to the actual game's name; "Marc Eckō's Getting Up: Contents Under Pressure", which would then be looked up online.

Now, there is an issue with this concept, and that is that filenames with things other than the name of the game would kind of ruin it. For example, my personal way of naming game ISOs would result in "burnout3takedownslus21050100isogz", which obviously is too different to expect and put into this database. So yeah, it isn't a perfect solution, but it's an idea that someone smarter than me can play with and maybe come to a proper solution.

Anyway, this shit's getting long, so to conclude: better game name detection pls.

Also, I should mention that I have no programming experience, so this might be a really stupid way to go about it lol.

valters-tomsons commented 5 years ago

For the heathens who don't compress their ISOs.

These people already have perfect title detection, because it reads serial from iso file and gets the title from PCSX2 database.

There will never be an universal way of detecting games based solely on file names, because each person has their own naming method.

Your best bet would be just name game files without special characters and serial numbers or even using plain .ISOs for best detection.

Maybe somebody could write a .cso/.gz parser to read serials like we do for .iso files now, but I lacked motivation to do that.

HalfOfAKebab commented 4 years ago

Just a thought, searching for serials in filenames would be a decent fallback for if it doesn't find any other identifiable information

valters-tomsons commented 3 years ago

Added support to fallback reading serial from title, as of https://github.com/valters-tomsons/Spectabis/commit/9b445ac0b8acf7a27aa752d7ab45a33fd528e92b.