]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(app-store): Remove duplicated fields from app list response
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 23 Oct 2024 10:52:55 +0000 (12:52 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Wed, 23 Oct 2024 11:02:01 +0000 (13:02 +0200)
The props are already included and just causing the app list request to grow

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/settings/lib/Controller/AppSettingsController.php
lib/private/legacy/OC_App.php

index b6cd7884af0c2a74d995ee812f8135df462e1800..2fbebe3f607145520dea6c0858c4c1c13e7c41e9 100644 (file)
@@ -267,10 +267,6 @@ class AppSettingsController extends Controller {
                }
        }
 
-       private function getAllApps() {
-               return $this->allApps;
-       }
-
        /**
         * Get all available apps in a category
         *
@@ -279,7 +275,7 @@ class AppSettingsController extends Controller {
         */
        public function listApps(): JSONResponse {
                $this->fetchApps();
-               $apps = $this->getAllApps();
+               $apps = $this->allApps;
 
                $dependencyAnalyzer = new DependencyAnalyzer(new Platform($this->config), $this->l10n);
 
@@ -309,7 +305,6 @@ class AppSettingsController extends Controller {
                                $groups = json_decode($appData['groups']);
                        }
                        $appData['groups'] = $groups;
-                       $appData['canUnInstall'] = !$appData['active'] && $appData['removable'];
 
                        // fix licence vs license
                        if (isset($appData['license']) && !isset($appData['licence'])) {
@@ -318,14 +313,11 @@ class AppSettingsController extends Controller {
 
                        $ignoreMax = in_array($appData['id'], $ignoreMaxApps);
 
-                       // analyse dependencies
+                       // analyze dependencies
                        $missing = $dependencyAnalyzer->analyze($appData, $ignoreMax);
-                       $appData['canInstall'] = empty($missing);
                        $appData['missingDependencies'] = $missing;
-
-                       $appData['missingMinOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['min-version']);
-                       $appData['missingMaxOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['max-version']);
                        $appData['isCompatible'] = $dependencyAnalyzer->isMarkedCompatible($appData);
+                       $appData['isForceEnabled'] = $ignoreMax;
 
                        return $appData;
                }, $apps);
@@ -421,7 +413,6 @@ class AppSettingsController extends Controller {
                                'author' => $authors,
                                'shipped' => $this->appManager->isShipped($app['id']),
                                'version' => $currentVersion,
-                               'default_enable' => '',
                                'types' => [],
                                'documentation' => [
                                        'admin' => $app['adminDocs'],
@@ -430,15 +421,11 @@ class AppSettingsController extends Controller {
                                ],
                                'website' => $app['website'],
                                'bugs' => $app['issueTracker'],
-                               'detailpage' => $app['website'],
                                'dependencies' => array_merge(
                                        $nextCloudVersionDependencies,
                                        $phpDependencies
                                ),
                                'level' => ($app['isFeatured'] === true) ? 200 : 100,
-                               'missingMaxOwnCloudVersion' => false,
-                               'missingMinOwnCloudVersion' => false,
-                               'canInstall' => true,
                                'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '',
                                'score' => $app['ratingOverall'],
                                'ratingRecent' => $app['ratingRecent'],
@@ -447,7 +434,6 @@ class AppSettingsController extends Controller {
                                'active' => $this->appManager->isEnabledForUser($app['id']),
                                'needsDownload' => !$existsLocally,
                                'groups' => $groups,
-                               'fromAppStore' => true,
                                'appstoreData' => $app,
                        ];
                }
index 6afd4086cb3eb5503b306d2daffc9baf1d28fad4..a30ae39b70705a9ae95acac3a8b176f493434605 100644 (file)
@@ -508,12 +508,10 @@ class OC_App {
                                $info['active'] = $active;
 
                                if ($appManager->isShipped($app)) {
-                                       $info['internal'] = true;
+                                       $info['shipped'] = true;
                                        $info['level'] = self::officialApp;
-                                       $info['removable'] = false;
                                } else {
-                                       $info['internal'] = false;
-                                       $info['removable'] = true;
+                                       $info['shipped'] = false;
                                }
 
                                if (in_array($app, $supportedApps)) {