From bcda9a9193ce3d0331af17c513a86a02814d9cc5 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 9 Jan 2026 16:53:39 +0100 Subject: [PATCH] fix: Add installation status check to get_appstore_apps The app store was showing all apps as not installed because the get_appstore_apps RPC method didn't check installation status. Now it: - Gets list of installed packages via opkg list-installed - Adds 'installed: true/false' to each app based on whether its required package is in the installed list Co-Authored-By: Claude Opus 4.5 --- .../root/usr/libexec/rpcd/luci.secubox | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/package/secubox/secubox-core/root/usr/libexec/rpcd/luci.secubox b/package/secubox/secubox-core/root/usr/libexec/rpcd/luci.secubox index d38bded7..fe8d6b25 100755 --- a/package/secubox/secubox-core/root/usr/libexec/rpcd/luci.secubox +++ b/package/secubox/secubox-core/root/usr/libexec/rpcd/luci.secubox @@ -502,10 +502,27 @@ case "$1" in ;; get_appstore_apps) - # Return apps from main catalog with categories + # Return apps from main catalog with categories and installation status CATALOG_FILE="/usr/share/secubox/catalog.json" if [ -f "$CATALOG_FILE" ]; then - jq '{apps: .plugins, categories: .categories}' "$CATALOG_FILE" + # Get installed packages list once for efficiency + INSTALLED_PKGS=$(opkg list-installed 2>/dev/null | awk '{print $1}') + + # Process catalog and add installed status to each app + jq --arg installed_pkgs "$INSTALLED_PKGS" ' + { + apps: [.plugins[] | . + { + installed: ( + if .packages.required[0] then + ($installed_pkgs | split("\n") | index(.packages.required[0])) != null + else + false + end + ) + }], + categories: .categories + } + ' "$CATALOG_FILE" else echo '{"apps":[],"categories":{}}' fi