1
0
Fork 0

autoupdater: Move upstream.rstrip('/') to rest_api classes

This commit is contained in:
Félix Piédallu 2024-02-20 12:06:17 +01:00 committed by Salamandar
parent 8495456aac
commit e93bf7f0ff
2 changed files with 2 additions and 2 deletions

View file

@ -461,7 +461,7 @@ class AppAutoUpdater:
self, strategy: str, asset: Union[str, dict], infos: dict[str, Any]
) -> Optional[tuple[str, Union[str, dict[str, str]], str]]:
autoupdate = infos.get("autoupdate")
upstream = autoupdate.get("upstream", self.main_upstream).strip("/")
upstream = autoupdate.get("upstream", self.main_upstream)
version_re = autoupdate.get("version_regex", None)
allow_prereleases = autoupdate.get("allow_prereleases", False)
_, remote_type, revision_type = strategy.split("_")

View file

@ -15,7 +15,7 @@ class RefType(Enum):
class GithubAPI:
def __init__(self, upstream: str, auth: Optional[tuple[str, str]] = None):
self.upstream = upstream
self.upstream = upstream.strip("/")
self.upstream_repo = upstream.replace("https://github.com/", "").strip("/")
assert (
len(self.upstream_repo.split("/")) == 2