fix: ext short description for pre-installed extensions (#1744)
* fix: update `installed_extensions` entry after the ext has been unzipped * fix: show installedRelease description as fallback
This commit is contained in:
parent
6bbebe0cee
commit
af660fec14
|
@ -154,7 +154,7 @@ async def check_installed_extensions(app: FastAPI):
|
||||||
|
|
||||||
for ext in installed_extensions:
|
for ext in installed_extensions:
|
||||||
try:
|
try:
|
||||||
installed = check_installed_extension(ext)
|
installed = check_installed_extension_files(ext)
|
||||||
if not installed:
|
if not installed:
|
||||||
await restore_installed_extension(app, ext)
|
await restore_installed_extension(app, ext)
|
||||||
logger.info(
|
logger.info(
|
||||||
|
@ -187,13 +187,11 @@ async def build_all_installed_extensions_list() -> List[InstallableExtension]:
|
||||||
id=ext_id, name=ext_id, installed_release=release, icon=release.icon
|
id=ext_id, name=ext_id, installed_release=release, icon=release.icon
|
||||||
)
|
)
|
||||||
installed_extensions.append(ext_info)
|
installed_extensions.append(ext_info)
|
||||||
await add_installed_extension(ext_info)
|
|
||||||
await update_installed_extension_state(ext_id=ext_id, active=True)
|
|
||||||
|
|
||||||
return installed_extensions
|
return installed_extensions
|
||||||
|
|
||||||
|
|
||||||
def check_installed_extension(ext: InstallableExtension) -> bool:
|
def check_installed_extension_files(ext: InstallableExtension) -> bool:
|
||||||
if ext.has_installed_version:
|
if ext.has_installed_version:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -209,6 +207,9 @@ def check_installed_extension(ext: InstallableExtension) -> bool:
|
||||||
|
|
||||||
|
|
||||||
async def restore_installed_extension(app: FastAPI, ext: InstallableExtension):
|
async def restore_installed_extension(app: FastAPI, ext: InstallableExtension):
|
||||||
|
await add_installed_extension(ext)
|
||||||
|
await update_installed_extension_state(ext_id=ext.id, active=True)
|
||||||
|
|
||||||
extension = Extension.from_installable_ext(ext)
|
extension = Extension.from_installable_ext(ext)
|
||||||
register_ext_routes(app, extension)
|
register_ext_routes(app, extension)
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,8 @@
|
||||||
class="text-subtitle2 gt-sm"
|
class="text-subtitle2 gt-sm"
|
||||||
style="font-size: 11px; height: 34px"
|
style="font-size: 11px; height: 34px"
|
||||||
>
|
>
|
||||||
{{ extension.shortDescription }}
|
{{ extension.shortDescription ||
|
||||||
|
extension.installedRelease?.description }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-subtitle1 lt-md q-mt-sm q-mb-xs">
|
<div class="text-subtitle1 lt-md q-mt-sm q-mb-xs">
|
||||||
{{ extension.name }}
|
{{ extension.name }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user