fix: restore installed extensions

This commit is contained in:
Vlad Stan 2023-01-25 15:00:39 +02:00
parent 46faa62b8b
commit 8ab4cb8c08
2 changed files with 5 additions and 5 deletions

View file

@ -143,13 +143,13 @@ async def check_installed_extensions(app: FastAPI):
def check_installed_extension(ext: InstallableExtension) -> bool:
if ext.has_installed_version:
return True
zip_files = glob.glob(
os.path.join(settings.lnbits_data_folder, "extensions", "*.zip")
)
if ext.has_installed_version:
return True
if ext.zip_path not in zip_files:
ext.download_archive()
ext.extract_archive()
@ -166,7 +166,7 @@ async def restore_installed_extension(app: FastAPI, ext: InstallableExtension):
# mount routes for the new version
core_app_extra.register_new_ext_routes(extension)
if ext.module_installed:
if extension.upgrade_hash:
ext.nofiy_upgrade()

View file

@ -37,7 +37,7 @@ class Extension(NamedTuple):
return (
f"lnbits.extensions.{self.code}"
if self.upgrade_hash == ""
else f"lnbits.upgrades.{self.code}-{self.hash}.{self.code}"
else f"lnbits.upgrades.{self.code}-{self.upgrade_hash}.{self.code}"
)
@classmethod