DblK / tinshop

Tinshop is your own personal shop compatible with tinfoil
GNU Affero General Public License v3.0
46 stars 4 forks source link

Better File Browser names #40

Closed Helvio88 closed 1 year ago

Helvio88 commented 1 year ago

Should fix #39 by showing actual file name

DblK commented 1 year ago

This can't work. The name of the original file can be malformed or with additional information that we do not want to be in the listing in tinfoil.

I would suggest to ensure with HasGameIDInLibrary that the gameId is in the library and use c.Library()[file.GameID] (type TitleDBEntry) as base of information. Using properties Name, Region and the actual code file.GameInfo.

This will ensure we will have the same format as output in the listing. You can test it by adding an empty file for example named [0100CC00102B4000][v0].nsp in your games folder.

If you use the browser you should see the label Tony Hawk's™ Pro Skater™ 1 + 2 if you don't then the feature is not complete and can not be merged.

As suggested, we can thing about something like this Tony Hawk's™ Pro Skater™ 1 + 2 (EN)[0100CC00102B4000][v0].nsp to be displayed.

I hope I am clear enough for the change to be made.

Helvio88 commented 1 year ago

I believe I pulled it off! Added a function to convert ID to Base ID in case it's an Update or DLC ID. A combination of Title ID and Base ID allows for proper entry naming. Works on my test cases!

Perhaps some best practices could be implemented on my code, please forgive my amateur skills. But, it works!

DblK commented 1 year ago

Thx, I will have a look and once tested will come back to you.

DblK commented 1 year ago

I reviewed and make some changes