fix: restore installed extensions
This commit is contained in:
parent
46faa62b8b
commit
8ab4cb8c08
2 changed files with 5 additions and 5 deletions
|
|
@ -143,13 +143,13 @@ async def check_installed_extensions(app: FastAPI):
|
||||||
|
|
||||||
|
|
||||||
def check_installed_extension(ext: InstallableExtension) -> bool:
|
def check_installed_extension(ext: InstallableExtension) -> bool:
|
||||||
|
if ext.has_installed_version:
|
||||||
|
return True
|
||||||
|
|
||||||
zip_files = glob.glob(
|
zip_files = glob.glob(
|
||||||
os.path.join(settings.lnbits_data_folder, "extensions", "*.zip")
|
os.path.join(settings.lnbits_data_folder, "extensions", "*.zip")
|
||||||
)
|
)
|
||||||
|
|
||||||
if ext.has_installed_version:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if ext.zip_path not in zip_files:
|
if ext.zip_path not in zip_files:
|
||||||
ext.download_archive()
|
ext.download_archive()
|
||||||
ext.extract_archive()
|
ext.extract_archive()
|
||||||
|
|
@ -166,7 +166,7 @@ async def restore_installed_extension(app: FastAPI, ext: InstallableExtension):
|
||||||
|
|
||||||
# mount routes for the new version
|
# mount routes for the new version
|
||||||
core_app_extra.register_new_ext_routes(extension)
|
core_app_extra.register_new_ext_routes(extension)
|
||||||
if ext.module_installed:
|
if extension.upgrade_hash:
|
||||||
ext.nofiy_upgrade()
|
ext.nofiy_upgrade()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Extension(NamedTuple):
|
||||||
return (
|
return (
|
||||||
f"lnbits.extensions.{self.code}"
|
f"lnbits.extensions.{self.code}"
|
||||||
if self.upgrade_hash == ""
|
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
|
@classmethod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue