-
Notifications
You must be signed in to change notification settings - Fork 12
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
Download games as Homebrew Hub entries #25
base: main
Are you sure you want to change the base?
Conversation
avivace
commented
Feb 9, 2025
- Remap metadata to be compliant to Homebrew Hub Game schema Draft 4
- Remap filesystem output
metadata_hh["typetag"] = "game" | ||
if "links" in metadata["extra"]: | ||
for link in metadata["extra"]["links"].keys(): | ||
if "source" in link.lower(): | ||
metadata_hh["repository"] = metadata["extra"]["links"][link] | ||
if "license" in metadata["extra"]: | ||
for value in metadata["extra"]["license"].keys(): | ||
if "source" in link.lower(): | ||
metadata_hh["gameLicense"] = value | ||
if "genre" in metadata["extra"]: | ||
for value in metadata["extra"]["genre"].keys(): | ||
tags.append(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Links can contain arbitrary text, but the prefilled metadata selection can contain "GitHub" or "Source code", so let's try matching on more keys.
metadata["extra"]["license"]
does not seem to ever exist, butassets_license
andcode_license
are there. Should one or the other be used?- You can set the license without providing a link to its source code. Do you want to keep the
if source_code_found
check?
metadata_hh["typetag"] = "game" | |
if "links" in metadata["extra"]: | |
for link in metadata["extra"]["links"].keys(): | |
if "source" in link.lower(): | |
metadata_hh["repository"] = metadata["extra"]["links"][link] | |
if "license" in metadata["extra"]: | |
for value in metadata["extra"]["license"].keys(): | |
if "source" in link.lower(): | |
metadata_hh["gameLicense"] = value | |
if "genre" in metadata["extra"]: | |
for value in metadata["extra"]["genre"].keys(): | |
tags.append(value) | |
metadata_hh["typetag"] = "game" | |
source_code_found = False | |
if "links" in metadata["extra"]: | |
for link_name, link in metadata["extra"]["links"].items(): | |
if any(key in link_name.lower() for key in ("github", "source", "repo")): | |
metadata_hh["repository"] = link | |
source_code_found = True | |
if "code_license" in metadata["extra"]: | |
for value in metadata["extra"]["code_license"].keys(): | |
if source_code_found: | |
metadata_hh["gameLicense"] = value | |
if "genre" in metadata["extra"]: | |
tags = list(metadata["extra"]["genre"].keys()) |
Co-authored-by: Ryszard Knop <[email protected]>
Co-authored-by: Ryszard Knop <[email protected]>
FYI: The main branch is now running on uv, so Poetry will complain about its metadata missing if you rebase your changes locally on main. Other than that your changes merge in cleanly. |
Thanks for the heads up, I'll rebase and see if uv works on my branch then |