From 1d9537380b6db9cb33a169c5a96ce5cb7155dc9c Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Mon, 23 Sep 2024 17:05:00 +0300 Subject: [PATCH] fix(ex_app_fetcher): use new OCP ServerVersion Signed-off-by: Andrey Borysenko --- lib/Fetcher/AppAPIFetcher.php | 6 ++++-- lib/Fetcher/ExAppFetcher.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/Fetcher/AppAPIFetcher.php b/lib/Fetcher/AppAPIFetcher.php index 7b6a71dc..44996098 100644 --- a/lib/Fetcher/AppAPIFetcher.php +++ b/lib/Fetcher/AppAPIFetcher.php @@ -15,6 +15,7 @@ use OCP\Files\NotPermittedException; use OCP\Http\Client\IClientService; use OCP\IConfig; +use OCP\ServerVersion; use OCP\Support\Subscription\IRegistry; use Psr\Log\LoggerInterface; @@ -35,7 +36,8 @@ public function __construct( protected ITimeFactory $timeFactory, protected IConfig $config, protected LoggerInterface $logger, - protected IRegistry $registry + protected IRegistry $registry, + protected ServerVersion $serverVersion, ) { $this->appData = $appDataFactory->get('appstore'); } @@ -184,7 +186,7 @@ public function setVersion(string $version): void { */ protected function getChannel(): string { if ($this->channel === null) { - $this->channel = \OC_Util::getChannel(); + $this->channel = $this->serverVersion->getChannel(); } return $this->channel; } diff --git a/lib/Fetcher/ExAppFetcher.php b/lib/Fetcher/ExAppFetcher.php index 6057bf0a..1a786db4 100644 --- a/lib/Fetcher/ExAppFetcher.php +++ b/lib/Fetcher/ExAppFetcher.php @@ -12,6 +12,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Http\Client\IClientService; use OCP\IConfig; +use OCP\ServerVersion; use OCP\Support\Subscription\IRegistry; use Psr\Log\LoggerInterface; @@ -26,7 +27,8 @@ public function __construct( IConfig $config, CompareVersion $compareVersion, LoggerInterface $logger, - protected IRegistry $registry + protected IRegistry $registry, + protected ServerVersion $serverVersion, ) { parent::__construct( $appDataFactory, @@ -34,7 +36,8 @@ public function __construct( $timeFactory, $config, $logger, - $registry + $registry, + $serverVersion ); $this->compareVersion = $compareVersion;