Allow prereleases in autoupdater. Mainly to support Vikunja.
This commit is contained in:
parent
107d801e2c
commit
8b0474ee2e
1 changed files with 8 additions and 1 deletions
|
@ -447,6 +447,7 @@ class AppAutoUpdater:
|
||||||
) -> Optional[tuple[str, Union[str, dict[str, str]], str]]:
|
) -> Optional[tuple[str, Union[str, dict[str, str]], str]]:
|
||||||
upstream = autoupdate.get("upstream", self.main_upstream).strip("/")
|
upstream = autoupdate.get("upstream", self.main_upstream).strip("/")
|
||||||
version_re = autoupdate.get("version_regex", None)
|
version_re = autoupdate.get("version_regex", None)
|
||||||
|
allow_prereleases = autoupdate.get("allow_prereleases", False)
|
||||||
_, remote_type, revision_type = strategy.split("_")
|
_, remote_type, revision_type = strategy.split("_")
|
||||||
|
|
||||||
api: Union[GithubAPI, GitlabAPI, GiteaForgejoAPI]
|
api: Union[GithubAPI, GitlabAPI, GiteaForgejoAPI]
|
||||||
|
@ -464,8 +465,14 @@ class AppAutoUpdater:
|
||||||
releases: dict[str, dict[str, Any]] = {
|
releases: dict[str, dict[str, Any]] = {
|
||||||
release["tag_name"]: release
|
release["tag_name"]: release
|
||||||
for release in api.releases()
|
for release in api.releases()
|
||||||
if not release["draft"] and not release["prerelease"]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not allow_prereleases:
|
||||||
|
releases = {
|
||||||
|
name: info for name, info in releases.items()
|
||||||
|
if not info["draft"] and not info["prerelease"]
|
||||||
|
}
|
||||||
|
|
||||||
latest_version_orig, latest_version = self.relevant_versions(
|
latest_version_orig, latest_version = self.relevant_versions(
|
||||||
list(releases.keys()), self.app_id, version_re
|
list(releases.keys()), self.app_id, version_re
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue