diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index ae36d849c5ef1..d2d7897f79ada 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -148,10 +148,17 @@ public function setVersion(string $version, string $fileName = 'apps.json', bool $this->ignoreMaxVersion = $ignoreMaxVersion; } - - public function get($allowUnstable = false) { + public function get($allowUnstable = false): array { $allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git'; + $appStoreEnabled = $this->config->getSystemValueBool('appstoreenabled', true); + $internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true); + $isDefaultAppStore = $this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL; + + if (!$appStoreEnabled || (!$internetAvailable && $isDefaultAppStore)) { + return []; + } + $apps = parent::get($allowPreReleases); if (empty($apps)) { $this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']);