mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-27 02:37:13 +01:00
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:
|
||||
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()
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue