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

Download games as Homebrew Hub entries #25

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

avivace
Copy link

@avivace avivace commented Feb 9, 2025

@avivace avivace marked this pull request as draft February 9, 2025 16:49
@avivace avivace changed the title Download games as Homebrew Hub Download games as Homebrew Hub entries Feb 10, 2025
Comment on lines +256 to +267
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)
Copy link
Owner

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, but assets_license and code_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?
Suggested change
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())

avivace and others added 2 commits February 13, 2025 21:26
Co-authored-by: Ryszard Knop <[email protected]>
Co-authored-by: Ryszard Knop <[email protected]>
@DragoonAethis
Copy link
Owner

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.

@avivace
Copy link
Author

avivace commented Feb 25, 2025

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

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.

2 participants