Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Manual parser finds no apps #723

Open
schradert opened this issue Nov 6, 2024 · 3 comments · May be fixed by #727
Open

[BUG] Manual parser finds no apps #723

schradert opened this issue Nov 6, 2024 · 3 comments · May be fixed by #727

Comments

@schradert
Copy link

schradert commented Nov 6, 2024

  • Describe the bug

I can't get my Manual type parser to find my programs. I just says no apps found. I am specifying a Manifests Directory which exists and only has JSON files in it, each of which contains the config for a single title with all the specified fields in the manual entry: title, target, startIn, launchOptions, and appendArgsToExecutable. Can I show more verbose logging somehow? Anybody experienced this?

  • Steps to reproduce the behavior
  1. Populate empty directory with a chiaki.manifest.json file in it with the following contents:
{
  "title": "chiaki-ng",
  "target": "chiaki",
  "startIn": "./",
  "launchOptions": "",
  "appendArgsToExecutable": true
}
  1. Create a Manual parser in steam-rom-manager with the Manifests Directory set to the directory path above
  2. Test or run Add games
  • Expected behavior

This should find the config file and add the program!

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@schradert
Copy link
Author

schradert commented Nov 12, 2024

Okay I figured out that it does work if the contents are structured as an array:

[
  {
    "title": "chiaki-ng",
    "target": "chiaki",
    "startIn": "./",
    "launchOptions": "",
    "appendArgsToExecutable": true
  }
]

So, the FAQ is not accurate.

@schradert
Copy link
Author

Also it looks like it does matter that files have a .json extension.

@schradert
Copy link
Author

So, the FAQ is not accurate.

Now that I've reviewed this closer, I understand what's happening. I wasn't careful enough with how I reported the bug. Technically the contents of my chiaki.manifest.json in the failing scenario was:

{
  "appendArgsToExecutable": true,
  "launchOptions": "",
  "startIn": "./",
  "target": "chiaki",
  "title": "chiaki-ng"
}

I am generating JSON dynamically and by default it orders keys alphabetically. This matters because the parser only checks the value type of the first key. The parser will work correctly as long as the first key is a string in the top-level object case, which I have now tested successfully.

Maybe I'm the only one ever who will encounter this error, but I guess you never know. I can easily see someone doing the same thing I did or even manually ordering the fields by preference. This situation can be easily avoided by just forcing jsonObj to be an array if it isn't, and the code would be less fragile and cleaner IMHO.

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 a pull request may close this issue.

1 participant