summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/AppSettingsController.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index ac6e5d1850d..a44a252a747 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -334,12 +334,12 @@ class AppSettingsController extends Controller {
*/
public function listApps($category = '') {
$appClass = new \OC_App();
+ $manager = \OC::$server->query(\OC\App\AppStore\Manager::class);
switch ($category) {
// installed apps
case 'installed':
$apps = $appClass->listAllApps();
-
foreach($apps as $key => $app) {
$newVersion = $this->installer->isUpdateAvailable($app['id']);
$apps[$key]['update'] = $newVersion;
@@ -481,6 +481,14 @@ class AppSettingsController extends Controller {
return $app;
}, $apps);
+ // Add app store dump for app to data
+ $apps = array_map(function($appData) use ($manager) {
+ $appStoreData = $manager->getApp($appData['id']);
+ $appData['appstoreData'] = $appStoreData;
+ $appData['preview'] = isset($appStoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appStoreData['screenshots'][0]['url']) : '';
+ return $appData;
+ }, $apps);
+
return new JSONResponse(['apps' => $apps, 'status' => 'success']);
}