Github: Prefer classic version of released files.
This commit is contained in:
parent
f44712e53c
commit
1445f7d26e
|
@ -28,7 +28,7 @@ class GitHub(Web):
|
|||
latest_release = http.open(
|
||||
url=f"{cls.api_url}/repos/{repo_owner}/{repo_name}/releases/latest"
|
||||
).json()
|
||||
for asset in latest_release["assets"]:
|
||||
for asset in sorted(latest_release["assets"], key=lambda a: "classic" in a["name"].lower(), reverse=True):
|
||||
if Path(asset["name"]).suffix == ".zip":
|
||||
return super().download(addon, asset["browser_download_url"])
|
||||
raise FileNotFoundError("No zip file found for latest release")
|
||||
|
|
Loading…
Reference in a new issue