Skip to content

Commit

Permalink
Merge pull request #47870 from nextcloud/backport/47834/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Sep 16, 2024
2 parents c0eff12 + bae0b8f commit ef4b1c3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/private/App/AppStore/Fetcher/AppFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,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->info('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']);
Expand Down

0 comments on commit ef4b1c3

Please sign in to comment.