Skip to content

Conversation

@loathingKernel
Copy link
Contributor

Some UE asset manifests seem to have "OwnershipToken": "" instead of something strtobool could understand. When trying to import these through egl-sync an exception is being raised, which blocks importing other titles too.

loathingkernel@akasha Rare (develop) $ legendary egl-sync --import-only
[cli] INFO: Reading EGL game manifests...

Checking for importable games...
Traceback (most recent call last):
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/bin/legendary", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/cli.py", line 3097, in main
    cli.egs_sync(args)
    ~~~~~~~~~~~~^^^^^^
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/cli.py", line 1512, in egs_sync
    importable = self.core.egl_get_importable()
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/core.py", line 1797, in egl_get_importable
    return [g for g in self.egl.get_manifests()
                       ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/lfs/egl.py", line 69, in get_manifests
    return [EGLManifest.from_json(m) for m in self.manifests.values()]
            ~~~~~~~~~~~~~~~~~~~~~^^^
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/models/egl.py", line 96, in from_json
    tmp.ownership_token = strtobool(json.pop('OwnershipToken', 'False'))
                          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/loathingkernel/Projects/raredevs/Rare/venv/lib/python3.13/site-packages/legendary/utils/cli.py", line 90, in strtobool
    raise ValueError("invalid truth value %r" % (val,))
ValueError: invalid truth value ''

The other use of strtobool is in LGDRY_NO_WINE environment variable, which also causes an exception if set as LGDRY_NO_WINE=

loathingkernel@akasha ~ (master) $ LGDRY_NO_WINE= legendary launch Dodo
Traceback (most recent call last):
  File "/usr/bin/legendary", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.13/site-packages/legendary/cli.py", line 2827, in main
    default=strtobool(os.environ.get('LGDRY_NO_WINE', 'False')),
            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/legendary/utils/cli.py", line 90, in strtobool
    raise ValueError("invalid truth value %r" % (val,))
ValueError: invalid truth value ''

I believe in both cases it is fine to assume that an empty string input is false, hence adding it here.

Link to the relevant Rare issue: RareDevs/Rare#563

Some UE asset manifests seem to have `"OwnershipToken": ""` instead
of something `strtobool` could understand. When trying to import these
through `egl-sync` an exception is being raised, which blocks importing
other titles too.

The other use of `strtobool` is in `LGDRY_NO_WINE` environment variable,
which also causes an exception if set as `LGDRY_NO_WINE=`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant