ludusavi icon indicating copy to clipboard operation
ludusavi copied to clipboard

Add option to match more permissively by install directory and aliases

Open mtkennerly opened this issue 2 years ago • 8 comments

This would help ease cases like https://github.com/mtkennerly/ludusavi-playnite/issues/29. For example: ludusavi backup --permissive Overboard! would try to back up both Overboard! (by name) and Overboard! (2021) (by install directory).

Known aliases would require an addition to the manifest, like:

Overboard! (2021):
  steam:
    id: 1546920
    name: Overboard!
Overboard! (2021):
  aliases:
    - Overboard!

mtkennerly avatar Jan 15 '22 01:01 mtkennerly

I also had this issue yesterday and today. From the playnite app, ludusavi would not save a particular game, but if done through the program gui, it would works correctly. I investigated and found that it's related to the naming of the game.

The scanned game from the ludisavi gui was "Horizon Zero Dawn", however, the game in GOG and as it appear in playite is "Horizon Zero Dawn Complete Edition". As this game is not part of the manifest.yml, it cannot be backed up. I created a "custom game" configuration through the Gui as suggested and I can now backup it from the tool using the "*Complete Edition" name.

That Complete Edition also exists in PCGameWiki, normally there is an automatic redirect for the base game when we search for it. https://www.pcgamingwiki.com/w/index.php?title=Horizon_Zero_Dawn_Complete_Edition&redirect=no

I suppose there will be a lot of games with similar renaming that break things. Here are some example from my library. I just tested and each of them cannot be found "as-is" by ludusavi through the command line interface with a title search.

The Witcher 3: Wild Hunt - Game of the Year Edition Control Ultimate Edition Pillars of Eternity - Definitive Edition Rise of the Tomb Raider: 20 Year Celebration Shadow of the Tomb Raider: Definitive Edition STAR WARS: The Force Unleashed Ultimate Sith Edition The Witcher: Enhanced Edition Tomb Raider GAME OF THE YEAR EDITION Tyranny - Gold Edition X-Morph: Defense Complete Edition

There are also some edge cases -Titles were changed for the original game and the original cannot be found

For some other game, it's the reverse. The first one is the original game with the original name released in 2013, the second one was released in 2019.

Age of Empires II (2013) Age of Empires II: Definitive Edition If I had the original game with the original name "Age of Empires II", nothing would be found.

-Title match exactly but game cannot be found There are also games that are kinda not working even though the title match exactly what is in the manifest file

title : Tiny Tina's Assault on Dragon Keep: A Wonderlands One-shot Adventure command : ludusavi.exe backup --try-update --merge --preview --path "H:\Backup Jeux" "Tiny Tina's Assault on Dragon Keep: A Wonderlands One-shot Adventure" manifest :

... Tiny Thor: steam: id: 541310 'Tiny Tina''s Assault on Dragon Keep: A Wonderlands One-Shot Adventure': files: ...

Note that the title is in quotes (compared to other title like Tiny Thor) and the quotes inside are double-quoted to escape them

Soooo... It's a kind of a very hard issue to solve. The games stores uses whatever random names they want. If we could import a list of alias from PcGamingWiki, that would be good. Doing a permissive search on alias... might work, but there will be some always be some false positive. Example game "Control", which is part of multiple games, and "Control Ultimate Edition", the text to search.

I don't have a lot of good ideas to fix this one. On the Playnite side, perhaps we could uses some user defined field / tag / some other way to put an alias on the title. So that the ludusavi playnite plugin uses the tag if it exists and the title otherwise. For the time being, the workaround is checking the game with a correct name in the manifest, and adding a custom game with the broken name

JeDi UlTiMaTe Game of the YEAR GOLD DEFINITIVE EDITION 100 YEAR CELEBRATION ENHANCED thanks :)

timemaster67 avatar Feb 21 '22 05:02 timemaster67

An idea just popped in my head not long after this wall of text (sry for the long post) What if the backup command allowed to receive the path of the game to backup ? that would provide another title to search for, and would work similar to the Gui search. I also wonter if we could have some kind of list for the games main .exe/executable and find the base title from that.

timemaster67 avatar Feb 21 '22 05:02 timemaster67

Thanks for the extra details and thoughts :+1:

I'll look into enhancing the manifest updater script to check for wiki redirects and/or the Steam API in order to build up a list of aliases.

While we could try incorporating folder/exe names, I don't think the results would be reliable enough, and it'd only work when Ludusavi is triggered from something like Playnite. I'd like the solution to work for Ludusavi on its own as well.

Note that the title is in quotes (compared to other title like Tiny Thor) and the quotes inside are double-quoted to escape them

That's very strange. The quotes shouldn't be the reason, but I saw the same problem just now on my system. While I was editing the manifest to try to figure it out, it suddenly started working, and now I can't make it happen again. Could you make a backup of your local manifest, delete the original, and see if the problem happens when you run Ludusavi again? If that makes the problem go away, could you retry with the backup of the problematic manifest (to make sure the issue comes back) and send it to me as well?

mtkennerly avatar Feb 24 '22 10:02 mtkennerly

Ludusavi crash after deleting the manifest. this is version v0.10.0-win64 released on 2021-03-13.

  1. Go to C:\Users\xxx\AppData\Roaming\ludusavi and make a backup of manifest.yaml
  2. Delete manifest.yaml
  3. run Ludusavi with command line params : ludusavi backup --path "xxxxx\ludusavi-v0.10.0-win64\backup" "any game" thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "Le fichier spécifié est introuvable." }', src\manifest.rs:152:61 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

ludusavi backup --path "xxxxx\ludusavi-v0.10.0-win64\backup" "any game" thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "Le fichier spécifié est introuvable." }', src\manifest.rs:152:61 stack backtrace: 0: 0x7ff665a3eafe - 1: 0x7ff665a5983b - 2: 0x7ff665a367d8 - 3: 0x7ff665a419ed - 4: 0x7ff665a41454 - 5: 0x7ff665a422fe - 6: 0x7ff665a41e21 - 7: 0x7ff665a3f45f - 8: 0x7ff665a41d79 - 9: 0x7ff665a57390 - 10: 0x7ff665a571d3 - 11: 0x7ff665576ec6 - 12: 0x7ff6655400bd - 13: 0x7ff6655df08f - 14: 0x7ff66560bbe6 - 15: 0x7ff66552801c - 16: 0x7ff665a425e4 - 17: 0x7ff6655df9d7 - 18: 0x7ff665a6e7b0 - 19: 0x7ff8447f7034 - BaseThreadInitThunk 20: 0x7ff844b42651 - RtlUserThreadStart

If started graphically, nothing will show up.

timemaster67 avatar Mar 03 '22 01:03 timemaster67

Ho it appears that if you simply move/rename the file C:\Users\xx\AppData\Roaming\ludusavi\manifest.yml while config.yml is there, the program crash, but if you move/rename the whole folder C:\Users\xx\AppData\Roaming\ludusavi, then both config and manifest are recreated/downloaded. Sorry for the confusion.

After retrying, both the old and the new manifest cause the issue of the game not found In both case, the game is quoted in the manifest file. See the attached zip with the old and new manifest.

command : ludusavi.exe backup --path backup "Tiny Tina's Assault on Dragon Keep: A Wonderlands One-shot Adventure" No info for these games:

  • Tiny Tina's Assault on Dragon Keep: A Wonderlands One-shot Adventure

ludusavi.zip

timemaster67 avatar Mar 03 '22 01:03 timemaster67

Ah, I just realized it's because the command includes One-shot (lowercase S), whereas the title in the manifest has One-Shot (uppercase S). It works when the capitalization matches. All the stores seem to use One-shot, though, so it's definitely confusing that the manifest/PCGW capitalize it differently. A permissive option should probably ignore capitalization as well.

Thanks for finding the crash as well! I'll get that fixed up.

mtkennerly avatar Mar 03 '22 14:03 mtkennerly

Ah, I just realized it's because the command includes One-shot (lowercase S), whereas the title in the manifest has One-Shot (uppercase S). It works when the capitalization matches. All the stores seem to use One-shot, though, so it's definitely confusing that the manifest/PCGW capitalize it differently. A permissive option should probably ignore capitalization as well.

Thanks for finding the crash as well! I'll get that fixed up.

I see, it was not obvious :) I would even go with the default configuration of ignoring case / doing a case insensitive search. I don't think there is a difference between "Horizon Zero Dawn", "horizon zero dawn" and "Horizon zero dawn". And if there is really some games that have the same name, it's not a matter of case that will fix it. While inspecting the manifest, I saw some game that had the same name and they were differentiated by the year of the release. Example "In The Dark (2018)" and "In The Dark" by different developpers.

As a programmer, I do think of case sensitivity when doing compare (db, code etc), but as a gamer, I should not have to think about it. I am not asking about a fuzzy search here, just a case-insensitive search by default. Think about it and let me know, thank you :)

timemaster67 avatar Mar 28 '22 00:03 timemaster67

I would want to keep the CLI case-sensitive by default, since the CLI is programmer-oriented, but the Playnite plugin should definitely use any new permissive option by default to get case-insensitive matching.

mtkennerly avatar Apr 05 '22 05:04 mtkennerly

Probably related is Brigador: Up-Armored Edition (GOG / PC Gaming Wiki): the GOG Linux native version is stored in

/home/myself/GOG Games/Brigador UpArmored Edition

Once again the JeDi UlTiMaTe Game of the YEAR GOLD DEFINITIVE EDITION 100 YEAR CELEBRATION ENHANCED-effect ...

sluedecke avatar Aug 31 '22 22:08 sluedecke

Rather than try to track specific aliases for each game, which would inevitably be an incomplete list, I'm going to try to handle common patterns in a generic way. My plan is for the next release to have a --fuzzy option that ignores:

  • capitalization
  • editions that are clearly separated by punctuation (The Witcher 3: Wild Hunt - Game of the Year Edition)
  • editions that are just one word (Control Ultimate Edition)
    • If they're longer and aren't separated by punctuation, then it would be ambiguous, but I can make special cases for ones like "Game of the Year Edition"
  • year suffixes (Overboard! (2021))
  • special symbols (LEGO® The Hobbit™)

That should cover the vast majority of issues. I'm open to ideas for any other patterns or special cases to include.

mtkennerly avatar Oct 03 '22 08:10 mtkennerly