UncleGoogle / galaxy-integration-humblebundle

Humble Bundle integration for GOG Galaxy 2.0
GNU General Public License v3.0
185 stars 19 forks source link

"Gremlins, Inc." parsed as two games "Gremlins (Steam)" and "Inc. (Steam)" #100

Closed JanPokorny closed 4 years ago

JanPokorny commented 4 years ago

Describe the bug The game "Gremlins, Inc." appears like this: obrazek

It used to appear correctly some time ago. No other games have " (Steam)" appended to the name.

Expected behavior It's a single game, "Gremlins, Inc.": obrazek

Probably an issue with handling the comma?

Plugin installed directly from Galaxy

UncleGoogle commented 4 years ago

Right, the problem is "as designed" due to #87

Please report to Galaxy providing game_id (it should be in your log file - sent as owned_games). GOG should:

  1. Rename the first game (Gremlins)
  2. Hide/mark as spam the second (Inc.) using provided game_id
JanPokorny commented 4 years ago

@UncleGoogle Let me see if I understand correctly. Humble sometimes uses commas to separate game names in key title, thus you have no way of actually knowing if it's two games or one?

"Gremlins" appears to be recognized as a specific Atari game, including the description.

obrazek

Wouldn't "renaming it" actually cause more problems? Or does that rename just the game coming from Humble?

Also, does that mean all games that have comma in name are "broken"? Like "Papers, Please" and all of the "Warhammer 40,000"?

UncleGoogle commented 4 years ago

Also, does that mean all games that have comma in name are "broken"? Like "Papers, Please" and all of the "Warhammer 40,000"?

Not always broken, but yes, the root problem is like that.

@UncleGoogle Let me see if I understand correctly. Humble sometimes uses commas to separate game names in key title, thus you have no way of actually knowing if it's two games or one?

I have Steam and Origin keys that contains 3-6 titles, separated by coma.

Wouldn't "renaming it" actually cause more problems? Or does that rename just the game coming from Humble?

I mean, renaming by GOG. Plugin will send:

Galaxy will display probably both for the first time any user reports such game id. Then, someone on GOG will hide '000' as it makes no sense, and no more users will have this problem, 'warhammer_staem_key_2' will be ignored. If GOG will also rename 'Warhammer 40' to 'Warhammer 40,000' in their database, the title comming from my plugin will be ignored, 'warhammer_steam_key_1' will match with 'Warhammer 40,000'.

JanPokorny commented 4 years ago

@UncleGoogle For the Warhammer 40,000 games, there are actually multiple with titles like "Warhammer 40,000: Something", "Warhammer 40,000: Something Else", will your plugin notice those are different games?

Having GOG solve it feels like a shitty solution, when this is a problem caused by the integration (or, rather, by Humble not giving the info in a readable way). Having a local whitelist of "names with commas" would be a better option IMO, but that requires actually having the list. Good thing I have just harvested all games from the Humble Store* and filtered those with comma** in name:

3DMark, PCMark 10 & VRMark Bundle
A Rite from the Stars Makoan Legend Edition DLC - Artbook, Official Guide, and Soundtrack
About Love, Hate and the other ones
Axe, Bow & Staff
Bolt Riley, A Reggae Adventure - Chapter 1
Borderlands 3: Guns, Love and Tentacles
Codename: Panzers, Phase One
Codename: Panzers, Phase Two
Cook, Serve, Delicious!
Cook, Serve, Delicious! 2!!
Dude, Stop
Duke Grabowski, Mighty Swashbuckler
Europa Universalis IV - Guns, Drums and Steel Music Pack Volume 2
Europa Universalis IV: Guns, Drums and Steel Music Pack
Football, Tactics & Glory
Good Night, Knight
Grand Theft Auto V, Criminal Enterprise Starter Pack and Great White Shark Card Bundle
Grand Theft Auto V, Criminal Enterprise Starter Pack and Megalodon Shark Card Bundle
Grand Theft Auto V, Criminal Enterprise Starter Pack and Whale Shark Card Bundle
Gremlins, Inc.
Gremlins, Inc. – Original Soundtrack
Gremlins, Inc. – The Governor Edition
Gremlins, Inc. – Astral Gamblers
Gremlins, Inc. – Automated Competitors
Gremlins, Inc. – Card Game, Print & Play Set
Gremlins, Inc. – Digital Artbook
Gremlins, Inc. – Famous Figures
Gremlins, Inc. – Uninvited Guests
Guns, Gore & Cannoli
Guns, Gore and Cannoli 2
Hack, Slash & Backstab
Hack, Slash, Loot
Hamlet or the Last Game without MMORPG Features, Shaders and Product...
Hot Dogs, Horseshoes & Hand Grenades
Human, we have a problem
I, Hope
I, Zombie
Invisible, Inc + Contingency Plan Bundle
Invisible, Inc - Contingency Plan
Invisible, Inc.
Just Cause™ 3: Air, Land & Sea Expansion Pass
Mafia III - Faster, Baby!
Magicka 2: Ice, Death, and Fury
My Tower, My Home
Orb Labs, Inc
Papers, Please
Sir, You Are Being Hunted
Slow Down, Bull
Sorry, James
STAR WARS™ Battlefront (Classic, 2004)
STAR WARS™ Battlefront™ II (Classic, 2005)
That Dragon, Cancer
The Haunted Island, a Frog Detective Game
Total War Saga: THRONES OF BRITANNIA - Blood, Sweat and Spears
Ultimate Warhammer 40,000 Collection
Upwards, Lonely Robot
Warhammer 40,000 - Eternal Crusade - Imperium Edition
Warhammer 40,000 - Eternal Crusade - Squadron Edition
Warhammer 40,000: Armageddon
Warhammer 40,000: Armageddon - Da Orks
Warhammer 40,000: Dawn of War - Master Collection
Warhammer 40,000: Dawn of War II - Grand Master Collection
Warhammer 40,000: Dawn of War II - Master Collection
Warhammer 40,000: Dawn of War II: Retribution - Last Stand Tau Commander
Warhammer 40,000: Deathwatch - Enhanced Edition
Warhammer 40,000: Gladius - Chaos Space Marines
Warhammer 40,000: Gladius - Fortification Pack
Warhammer 40,000: Gladius - Reinforcement Pack
Warhammer 40,000: Gladius - Relics of War
Warhammer 40,000: Gladius - T'au
Warhammer 40,000: Gladius - Tyranids
Warhammer 40,000: Inquisitor - Martyr
Warhammer 40,000: Inquisitor - Prophecy
Warhammer 40,000: Kill Team
Warhammer 40,000: Mechanicus
Warhammer 40,000: Mechanicus - Heretek
Warhammer 40,000: Mechanicus - Omnissiah Edition
Warhammer 40,000: Regicide
Warhammer 40,000: Sanctus Reach
Warhammer 40,000: Sanctus Reach - Horrors of the Warp
Warhammer 40,000: Sanctus Reach - Legacy of the Weirdboy
Warhammer 40,000: Sanctus Reach - Sons of Cadia
Warhammer 40,000: Space Marine
Warhammer 40,000: Space Marine Collection
Warhammer 40,000: Space Wolf
Warhammer 40,000: Space Wolf - Fall of Kanak
Warhammer 40,000: Space Wolf - Saga of the Great Awakening
Warhammer 40,000: Space Wolf - Sentry Gun Pack
Warhammer 40,000: Space Wolf - Sigurd Ironside
Warhammer® 40,000: Dawn of War II: Retribution
Warhammer® 40,000: Dawn of War® - Dark Crusade
Warhammer® 40,000: Dawn of War® II Chaos Rising
Warhammer® 40,000: Dawn Of War® – Winter Assault
Warhammer® 40,000™: Dawn of War® II
Warhammer® 40,000™: Dawn of War® II - Retribution - Ridiculously Bloody Blood Pack
Warhammer® 40,000™: Dawn of War® II - Retribution - The Last Stand Necron Overlord
Warhammer® 40,000™: Dawn of War® III
Warlock 2: The Exiled - The Good, the Bad, & the Muddy

*I know that Humble Store does not necessarily cover all games from bundles/monthly

**If you instead use comma followed by a space as a separator, then the Warhammer games can be dropped

JanPokorny commented 4 years ago

(And here is the list, for educational purposes.) humble_games.txt

UncleGoogle commented 4 years ago

I must admit that you're right, this is shitty solution.

Thanks for the list, may be useful.

First of all we can filter out store purchases. Assuming key bought from store contains only one game.

Then, the whitelist may be used to:

Whitelist should be actualized from time to time, so it would be nice to have parser. But, I dont think humble sells in store all the games sold whenever in bundles. So we also need whitelist of all keys that have display_name containing game/games with coma in title sold in all hostorical bundles.

Code needs refactor. Also api layer and model should separated from plugin related logic.

I wish gog have first class support for keys that can store multiple games.

JanPokorny commented 4 years ago

A quick and simple solution would be something like (pseudocode):

whitelist.sort(key=lambda x: -len(x)) # sort from longest to shortest
for whitelisted_title in whitelist:
  humble_title = humble_title.replace(whitelisted_title, whitelisted_title.replace(",", "<PLACEHOLDER>"))

titles = [title.replace("<PLACEHOLDER>", ",") for title in humble_title.split(", ")]

The Correct™ way would be some parsing logic, but... Assuming that everything is reasonably short, this is the KISS™ solution

JanPokorny commented 4 years ago

And in case you wanted to be 99.999% sure to include all games, here's the same list for Steam. Although it's pretty long and I think that for all practical purposes, using the list above and occasionally adding to it if somebody reports a broken game is enough. steam_comma.txt

(It is surprisingly easy to obtain a list of all Steam apps, they literally have an API endpoint for that 😁)

UncleGoogle commented 4 years ago

@JanPokorny could you test this build if Gremlins are shown properly? split_keys_fix.zip

JanPokorny commented 4 years ago

@UncleGoogle Sorry for the wait. Sadly this doesn't seem to help, I have removed the Humble integration folder, replaced it with the provided build, restarted Galaxy, re-connected my account from the Galaxy UI, and synced integrations, but the game list stayed the same. Log (after subsequent restart of Galaxy) is attached:

plugin-humble-f0ca3d80-a432-4d35-a9e3-60f27161ac3a.log

UncleGoogle commented 4 years ago

@JanPokorny I've accidently zip old plugin version. Try this: split_keys.zip

JanPokorny commented 4 years ago

@UncleGoogle This one crashes immediately after pressing Connect. (Should I perhaps clear some plugin cache?)

UncleGoogle commented 4 years ago

I'm sorry, I should check on my machine first. Apparently problems with building dependencies from Python3.8.

For now, please remove it and install humble again by Connectin in Galaxy. Then extract content of this zip into humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a directory overwriting files.

split_keys_src.zip

JanPokorny commented 4 years ago

Did that, still doesn't seem to do anything. (Are you sure it's not a caching issue?)

plugin-humble-f0ca3d80-a432-4d35-a9e3-60f27161ac3a.log

BTW I'm leaving soon and won't be able to test for a few days, so no hurry

UncleGoogle commented 4 years ago

I've send you old code again. Being a dad makes me really tired sometimes...

source: keys_split_fix_really.zip

UncleGoogle commented 4 years ago

@JanPokorny the whole windows build again: humble_split_keys_whole_build.zip

JanPokorny commented 4 years ago

@UncleGoogle Thanks for your patience. This one works!

obrazek

(I do not have any "split keys" though, so make sure that these still work.)

UncleGoogle commented 4 years ago

@JanPokorny Thanks for reporting and testing :)

JanPokorny commented 4 years ago

@UncleGoogle Thanks for making this integration! It must be a nightmare dealing with Humble, given how chaotic it is. I'm glad I could be of some help.

UncleGoogle commented 4 years ago

I'm glad that it is useful :)

Maybe not as bad as "nightmare" but 1) Humble API and the whole system is heavily optimized for humblebundle.com needs; 2) there is freedom for external developers what they put under key, or what they put in download (no standards in file formats or anything) and other stuff. That is why there is no official humble launcher yet.