1
0
Fork 0

small refactor

This commit is contained in:
OniriCorpe 2024-02-14 05:00:07 +01:00
parent 5570b003ab
commit fb0e0e12d1

View file

@ -326,19 +326,12 @@ class AppAutoUpdater:
for release in releases for release in releases
if release["tag_name"] == latest_version_orig if release["tag_name"] == latest_version_orig
][0] ][0]
if "github" in strategy or "gitlab" in strategy:
latest_assets = { latest_assets = {
a["name"]: a["browser_download_url"] a["name"]: a["browser_download_url"]
for a in latest_release["assets"] for a in latest_release["assets"]
if not a["name"].endswith(".md5") if not a["name"].endswith(".md5")
} }
elif "gitea" in strategy or "forgejo" in strategy: if ("gitea" in strategy or "forgejo" in strategy) and latest_assets == "":
latest_assets = {
a["name"]: a["browser_download_url"]
for a in latest_release["assets"]
if not a["name"].endswith(".md5")
}
if latest_assets == "":
# if empty (so only the base asset), take the tarball_url # if empty (so only the base asset), take the tarball_url
latest_assets = latest_release["tarball_url"] latest_assets = latest_release["tarball_url"]
if strategy == "_release": if strategy == "_release":