trembon / switch-library-manager

Complete solution to manage, organize and keep your local switch backup game library up to date . Cross platform, supports all game formats.
MIT License
46 stars 2 forks source link

Different DLC with identical names will replace one another if they are named the same. #16

Closed TomTurbine closed 5 months ago

TomTurbine commented 5 months ago

Example

Crash Bandicoot 4 Its About Time [Tubular Skins 1] [010073401175F001] Crash Bandicoot 4 Its About Time [Tubular Skins 2] [010073401175F001]

Both organize to Crash Bandicoot 4 Its About Time (DLC)(Crash Bandicoot 4 - Totally Tubular Skins)(0)

So one deletes the other if you try and hit the organize button. Then the next scan shows it as missing the DLC it just deleted.

Need a way to automatically rename DLCs that resolve to the same file name.

Edit: Just changed the organizing method to also include the version number and it resolved it.

trembon commented 5 months ago

sounds good that you solved it yourself looking at that DLC i can find two versions of it ID 010073401175f001 and 010073401175f002 guessing your problem is that SLM finds your files as the same DLC because the files has the same ID

so just the question is, are you sure they should have the same ID?

looking in the titles.json file and there are no versions of that DLC, only different IDs

TomTurbine commented 5 months ago

Originally I used the settings to rename it without including the ID number. So, when it came to DLC which had an identical name, it just had one overwrite the other which then showed up as missing when you did the next scan.

I would say to just include a setting where if it tries to rename a file to something that already exists it appends something to the end of it to keep them from overwriting.

With the one I did above, both of those files resolved to "Crash Bandicoot 4 Its About Time (DLC)(Crash Bandicoot 4 - Totally Tubular Skins)(0)"

Could just throw a check in so it would resolve to something like "Crash Bandicoot 4 Its About Time (DLC)(Crash Bandicoot 4 - Totally Tubular Skins)(0)" & "Crash Bandicoot 4 Its About Time (DLC)(Crash Bandicoot 4 - Totally Tubular Skins)(0)(2)"

Just to keep it from overwriting anything.

TomTurbine commented 5 months ago

Also, one thing I noticed, with the game ".hackG.U. Last Recode". It sorted it into the proper folder, but it doesn't seem to detect I have it anymore after putting it there. Guessing because it starts with a period in the name maybe.

trembon commented 5 months ago

thank you for more information here, i think i have a grip of the problem now to solve the problem we will need to add a check within the duplicate name check to see if its possible that two files can generate the same name but have different IDs, as we still want to have the duplicate name check for when they are just normal duplicates

regarding the dot problem, i think i have seen something about this in the original repo as well that this can be a problem, but i will create a separate issue for this, as its not the same problem as the duplicate naming

TomTurbine commented 5 months ago

Thanks for the responses. much appreciated and thanks for your work. I will let you know if I come across anything else.

Edit: Also, separate thing but putting it here because I don't think its the fault of your app but the database it downloads but it identifies the Tactics Ogre Reborn game is one of its DLC.

trembon commented 5 months ago

@TomTurbine i think i have a working solution for not removing duplicated DLCs by name in the latest PR you can access the compiled files by the github action tab (https://github.com/trembon/switch-library-manager/actions/runs/8334379587) can you see how it works for you?

TomTurbine commented 5 months ago

@TomTurbine i think i have a working solution for not removing duplicated DLCs by name in the latest PR you can access the compiled files by the github action tab (https://github.com/trembon/switch-library-manager/actions/runs/8334379587) can you see how it works for you?

I am kinda busy but will see what I can do, have to leave town tomorrow and won't be back till Wednesday. If I get a chance I will try it on that game I linked before I got to bed and let you know.

Edit:

Just tried it and they completed to

"Crash Bandicoot 4 Its About Time (Crash Bandicoot 4 - Totally Tubular Skins)[v0].nsp"
"Crash Bandicoot 4 Its About Time (Crash Bandicoot 4 - Totally Tubular Skins)[v0](1).nsp"

So, I would call that a win.

For some reason it wants to complete the name as a link on here, but needless to say, it worked.

trembon commented 5 months ago

sounds good! i think i found a case where my solution can be a problem, so i will try to see if i can catch all cases here, so i will keep the issue until i know everything is resolved