fix: make github releases g first

This commit is contained in:
Vlad Stan 2023-01-16 15:58:26 +02:00
parent 86d45cdb50
commit dd0c97eefc

View File

@ -299,6 +299,17 @@ class InstallableExtension(BaseModel):
logger.warning(f"Cannot fetch extensions manifest at: {url}") logger.warning(f"Cannot fetch extensions manifest at: {url}")
continue continue
manifest = resp.json() manifest = resp.json()
if "repos" in manifest:
for r in manifest["repos"]:
ext = await InstallableExtension.from_repo(
r["organisation"], r["repository"]
)
if ext:
if ext.id in extension_id_list:
continue
extension_list += [ext]
extension_id_list += [ext.id]
if "extensions" in manifest: if "extensions" in manifest:
for e in manifest["extensions"]: for e in manifest["extensions"]:
if e["id"] in extension_id_list: if e["id"] in extension_id_list:
@ -318,16 +329,6 @@ class InstallableExtension(BaseModel):
) )
] ]
extension_id_list += [e["id"]] extension_id_list += [e["id"]]
if "repos" in manifest:
for r in manifest["repos"]:
ext = await InstallableExtension.from_repo(
r["organisation"], r["repository"]
)
if ext:
if ext.id in extension_id_list:
continue
extension_list += [ext]
extension_id_list += [ext.id]
except Exception as e: except Exception as e:
logger.warning(f"Manifest {url} failed with '{str(e)}'") logger.warning(f"Manifest {url} failed with '{str(e)}'")
@ -344,6 +345,14 @@ class InstallableExtension(BaseModel):
logger.warning(f"Cannot fetch extensions manifest at: {url}") logger.warning(f"Cannot fetch extensions manifest at: {url}")
continue continue
manifest = resp.json() manifest = resp.json()
if "repos" in manifest:
for r in manifest["repos"]:
if r["id"] == ext_id:
repo_releases = await ExtensionRelease.all_releases(
r["organisation"], r["repository"]
)
extension_releases += repo_releases
if "extensions" in manifest: if "extensions" in manifest:
for e in manifest["extensions"]: for e in manifest["extensions"]:
if e["id"] == ext_id: if e["id"] == ext_id:
@ -357,12 +366,6 @@ class InstallableExtension(BaseModel):
description=e["shortDescription"], description=e["shortDescription"],
) )
] ]
if "repos" in manifest:
for r in manifest["repos"]:
repo_releases = await ExtensionRelease.all_releases(
r["organisation"], r["repository"]
)
extension_releases += repo_releases
except Exception as e: except Exception as e:
logger.warning(f"Manifest {url} failed with '{str(e)}'") logger.warning(f"Manifest {url} failed with '{str(e)}'")