From fa69e7de65806dd082b6c9561b2b5e31f142a78e Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 8 Jul 2026 09:34:34 -0400 Subject: [PATCH] fix: restore default SpotiFLAC Extension Store registry when EXTENSION_REPOSITORIES is empty, and backup/restore staged native libraries on gamdl-aio startup --- allstarr/Services/Common/ExtensionManager.cs | 6 +++++- gamdl-aio/main.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/allstarr/Services/Common/ExtensionManager.cs b/allstarr/Services/Common/ExtensionManager.cs index 4c01d75f..40fa6f60 100644 --- a/allstarr/Services/Common/ExtensionManager.cs +++ b/allstarr/Services/Common/ExtensionManager.cs @@ -50,7 +50,11 @@ public class ExtensionManager public List GetConfiguredRepositories() { - var repos = _configuration["EXTENSION_REPOSITORIES"] ?? "https://raw.githubusercontent.com/spotiflacapp/SpotiFLAC-Extension/main/registry.json"; + var repos = _configuration["EXTENSION_REPOSITORIES"]; + if (string.IsNullOrWhiteSpace(repos)) + { + repos = "https://raw.githubusercontent.com/spotiflacapp/SpotiFLAC-Extension/main/registry.json"; + } return repos.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList(); } diff --git a/gamdl-aio/main.py b/gamdl-aio/main.py index 0f3cde2a..2db2e182 100644 --- a/gamdl-aio/main.py +++ b/gamdl-aio/main.py @@ -118,6 +118,15 @@ async def init_apple_music_api(): @app.on_event("startup") async def startup_event(): + # Restore persistent staged libraries if they exist + persisted_libs_dir = DATA_DIR / "apple_libs" + if persisted_libs_dir.exists(): + logger.info("Restoring staged Apple native libraries from persistent data...") + SYSTEM_LIBS_DIR.mkdir(exist_ok=True, parents=True) + for f in persisted_libs_dir.glob("*.so"): + shutil.copy2(f, SYSTEM_LIBS_DIR / f.name) + logger.info(f"Restored library: {f.name}") + # Attempt to start the wrapper daemon on startup await start_wrapper_daemon() @@ -245,6 +254,14 @@ async def upload_apk(file: UploadFile = File(...)): temp_apk.unlink() + # Back up extracted libraries to persistent storage + persisted_libs_dir = DATA_DIR / "apple_libs" + persisted_libs_dir.mkdir(exist_ok=True, parents=True) + if SYSTEM_LIBS_DIR.exists(): + for f in SYSTEM_LIBS_DIR.glob("*.so"): + shutil.copy2(f, persisted_libs_dir / f.name) + logger.info("Backed up staged Apple native libraries to persistent storage.") + global wrapper_proc if wrapper_proc: wrapper_proc.terminate()