UncleGoogle / galaxy-integration-humblebundle

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

Games are listed while its just steam keys #54

Closed amaurydavid closed 4 years ago

amaurydavid commented 4 years ago

Describe the bug Games that are just steam keys are listed in Gog. In my case, Stardew valley is listed while it's just a steam key. So when I click on the "Install" button, it just display the message "Wait while we're launching Humble bundle" and nothing happens.

Expected behavior Only games that can be downloaded are listed. Or just indicate in the game detail that its a key to redeem (but I suppose it's not possible). Or, provide a way to redeem the key (am I dreaming?).

Provide logs INFO - Handling notification: method=install_game, params={'game_id': 'stardewvalley_freedombundle_steam'} 2019-11-19 13:27:55,226 - root - DEBUG - Task manager jsonrpc server: creating task 93 (install_game) 2019-11-19 13:27:55,226 - root - DEBUG - Task manager plugin external: creating task 490 (install_game) 2019-11-19 13:27:55,315 - root - ERROR - list indices must be integers or slices, not str Traceback (most recent call last): File "C:\Users\amaur\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\plugin.py", line 143, in install_game logging.error(f'Error for keygui: stderr_data', extra=args) File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32__init.py", line 1961, in error File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32__init__.py", line 1412, in error File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\init.py", line 1518, in _log File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\init__.py", line 1493, in makeRecord TypeError: list indices must be integers or slices, not str 2019-11-19 13:27:55,328 - root - DEBUG - Task manager plugin external: finished task 490 (install_game) 2019-11-19 13:27:55,329 - root - DEBUG - Task manager jsonrpc server: finished task 93 (install_game)

JanPokorny commented 4 years ago

You can open the config.ini file located inside the humble integration folder in %localappdata%\GOG.com\Galaxy\plugins\installed and configure what to show: keys (all or only not revealed), downloadable purchases, and/or trove games.

I do agree that the behavior for the "Install" button should be better for keys. I would suggest simply opening the key page in the browser.

UncleGoogle commented 4 years ago

Its a bug, small window showing your steam key should be displayed. Will be fixed in spare time..

JanPokorny commented 4 years ago

@UncleGoogle Thanks! Just opening the Humble page is enough, no need to reveal the key for the user.

UncleGoogle commented 4 years ago

@JanPokorny Revealing code would be hard because of crsf cookie on the web is used under "reveal" button. And no fear is not my purpose :) I'm just saying that there is already a small GUI to show it like that:

0aa786f0cda1fe6fda0dc9d634f0fa6d

Apparently there is bug in running this.

EDIT-------

@amaurydavid please replace 149 line of the plugin.py with this:

                    logging.error(f'Error for keygui: {stderr_data}', extra={'args': args[:-1]})

as shown in https://github.com/UncleGoogle/galaxy-integration-humblebundle/pull/56/files , restart Galaxy and try again. Real problem should be logged then. And what system do you use?

JanPokorny commented 4 years ago

@UncleGoogle your logging seems still borked...

2019-11-19 23:51:24,825 - root - ERROR - "Attempt to overwrite 'args' in LogRecord"
Traceback (most recent call last):
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\plugin.py", line 143, in install_game
    logging.error(f'Error for keygui: {stderr_data}', extra={'args': args[:-1]})
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 1961, in error
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 1412, in error
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 1518, in _log
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 1492, in makeRecord
KeyError: "Attempt to overwrite 'args' in LogRecord"

EDIT: I edited the args argument out and it resulted in:

2019-11-19 23:55:43,121 - root - ERROR - Error for keygui: b'Traceback (most recent call last):\r\n  File "C:\\Users\\JP\\AppData\\Local\\GOG.com\\Galaxy\\plugins\\installed\\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\\keysgui.py", line 8, in <module>\r\n    import toga\r\nModuleNotFoundError: No module named \'toga\'\r\n'

EDIT 2: I went ahead and looked into the keysgui.py file and found the test code. Decided to test it in terminal:

> python keysgui.py Test steam AAA-BBB
Traceback (most recent call last):
  File "keysgui.py", line 76, in <module>
    main()
  File "keysgui.py", line 62, in main
    ShowKey(human_name, key_type, key_val).main_loop()
  File "keysgui.py", line 23, in __init__
    super().__init__(f'{self._key_type} Key', self.APP_ID, icon=self.H_ICON)
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga\app.py", line 53, in __init__
    self.factory = get_platform_factory(factory)
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga\platform.py", line 42, in get_platform_factory
    from toga_winforms import factory
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga_winforms\factory.py", line 1, in <module>
    from .app import App, MainWindow
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga_winforms\app.py", line 8, in <module>
    from .libs import Threading, WinForms, user32, win_version, shcore
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga_winforms\libs\__init__.py", line 1, in <module>
    from .winforms import (  # noqa: F401
  File "C:\Users\JP\AppData\Local\GOG.com\Galaxy\plugins\installed\humble_f0ca3d80-a432-4d35-a9e3-60f27161ac3a\toga_winforms\libs\winforms.py", line 3, in <module>
    import clr
ImportError: DLL load failed while importing clr: %1 is not a valid Win32 application.

My opinion is: run away from multiplatform GUI development, just open the Humble Library page in the browser and call it a day.

UncleGoogle commented 4 years ago

@JanPokorny you've probably used plugin from @FriendsOfGalaxy fork (downloadable by Galaxy now). Looks like they pack plugin 3rd party modules in different way than me, so module cannot be imported properly. Hot-fixing...

I agree with opening browser when sth went wrong.

I cannot drop multiplatform GUI, as I need it to replace manual config edition. It's too problematic for average user.

JanPokorny commented 4 years ago

@UncleGoogle If it turns out to be problematic, you might also consider running a local webserver and opening the webpage for "cross-platform GUI".

UncleGoogle commented 4 years ago

Yeah, that's true. And coding CSS should be also faster. But opening webbrowser available from Galaxy cannot be done on demand. Only during logging. I can also use local files and use default webbrowser but this requires setting up local server. I will see.

There is release 0.5.3 https://github.com/UncleGoogle/galaxy-integration-humblebundle/releases to be installed manually. Within day or two it should be also autoupdated by Galaxy.