From 60083b1b5f30a2c1b0e59d3eeac7dd869c86c034 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sat, 28 Sep 2024 22:44:03 +0200 Subject: fix(theming): Use `AppConfig` for setting background image Signed-off-by: Ferdinand Thiessen --- apps/theming/lib/Service/BackgroundService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/theming/lib') diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index bf650874448..d403e77635c 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; } } -- cgit v1.2.3