diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-28 22:44:03 +0200 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-10-02 09:21:57 +0200 |
commit | 7ca6e45c7ac099c3e9afc998170a0e63a2f3531b (patch) | |
tree | 608f00377c9acc65c80677f0842b3094db7369ce | |
parent | fcf45b6869e35c3ebdada598318fe7de0d5d4e4a (diff) | |
download | nextcloud-server-7ca6e45c7ac099c3e9afc998170a0e63a2f3531b.tar.gz nextcloud-server-7ca6e45c7ac099c3e9afc998170a0e63a2f3531b.zip |
fix(theming): Use `AppConfig` for setting background imagebackport/48439/stable30
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r-- | apps/theming/lib/Service/BackgroundService.php | 4 | ||||
-rw-r--r-- | lib/private/Server.php | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index 6cb2b4abeb9..8ed8478de71 100644 --- a/apps/theming/lib/Service/BackgroundService.php +++ b/apps/theming/lib/Service/BackgroundService.php @@ -18,6 +18,7 @@ use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; +use OCP\IAppConfig; use OCP\IConfig; use OCP\Lock\LockedException; use OCP\PreConditionNotMetException; @@ -200,6 +201,7 @@ class BackgroundService { public function __construct( private IRootFolder $rootFolder, private IAppData $appData, + private IAppConfig $appConfig, private IConfig $config, private ?string $userId, ) { @@ -328,7 +330,7 @@ class BackgroundService { if ($handle && $image->loadFromFileHandle($handle) !== false) { $meanColor = $this->calculateMeanColor($image); if ($meanColor !== false) { - $this->config->setAppValue(Application::APP_ID, 'background_color', $meanColor); + $this->appConfig->setValueString(Application::APP_ID, 'background_color', $meanColor); return $meanColor; } } diff --git a/lib/private/Server.php b/lib/private/Server.php index a6f7cc61faa..3b86ded05cc 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1153,6 +1153,7 @@ class Server extends ServerContainer implements IServerContainer { $backgroundService = new BackgroundService( $c->get(IRootFolder::class), $c->getAppDataDir('theming'), + $c->get(IAppConfig::class), $c->get(\OCP\IConfig::class), $c->get(ISession::class)->get('user_id'), ); |