fix: restore default SpotiFLAC Extension Store registry when EXTENSION_REPOSITORIES is empty, and backup/restore staged native libraries on gamdl-aio startup

This commit is contained in:
joshpatra committed 2026-07-08 09:34:34 -04:00
1 parent f91a701104
commit fa69e7de65
2 files changed
+22 -1

No files matched your search

+5 -1
View File
@@ -50,7 +50,11 @@ public class ExtensionManager
public List<string> 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();
}
+17
View File
@@ -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()