From f8f8acef838377b65f9a29f9fc3e7e15cd633adc Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 9 Sep 2024 09:29:09 +0200 Subject: [PATCH 1/2] fix(appstore): return if appstore is manually disabled Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: camel case Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: log a debug log Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: typing Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: typo fix: typing --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 3f7f5e0a3bd71..6deeed98f0caf 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -180,10 +180,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); + + if (!$appStoreEnabled || !$internetAvailable) { + $this->logger->debug('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']); + return []; + } + $apps = parent::get($allowPreReleases); if (empty($apps)) { $this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']); From bae0b8f15e3a4adeb6e41933e11a16f6f6ff5302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Tue, 10 Sep 2024 16:00:56 +0200 Subject: [PATCH 2/2] fix(appstore): disabled appstore log level bump from debug to info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: John Molakvoæ --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 6deeed98f0caf..e6e35413e9226 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -187,7 +187,7 @@ public function get($allowUnstable = false): array { $internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true); if (!$appStoreEnabled || !$internetAvailable) { - $this->logger->debug('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']); + $this->logger->info('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']); return []; }