From 83ed204d9cbaddccdf008468d3e1d01415568e78 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 26 Sep 2023 20:08:54 +0530 Subject: [PATCH] Set default timeline path option --- lib/SystemConfigDefault.php | 3 +++ lib/Util.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/SystemConfigDefault.php b/lib/SystemConfigDefault.php index e1529c3e..b4d34ec4 100644 --- a/lib/SystemConfigDefault.php +++ b/lib/SystemConfigDefault.php @@ -69,6 +69,9 @@ return [ // 1080 => 1080p (and so on) 'memories.video_default_quality' => '0', + // Default timeline path for all users; if not set, default is '/Photos' + 'memories.default_timeline_path' => 'Photos/', + // Memories only provides an admin interface for these // https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews 'enabledPreviewProviders' => [], diff --git a/lib/Util.php b/lib/Util.php index bea8d079..4710b969 100644 --- a/lib/Util.php +++ b/lib/Util.php @@ -316,7 +316,8 @@ class Util public static function getTimelinePaths(string $uid): array { $config = \OC::$server->get(IConfig::class); - $paths = $config->getUserValue($uid, Application::APPNAME, 'timelinePath', null) ?? 'Photos/'; + $defaultTimelinePath = $config->getSystemValue('memories.default_timeline_path', 'Photos/'); + $paths = $config->getUserValue($uid, Application::APPNAME, 'timelinePath', null) ?? $defaultTimelinePath; return array_map(static fn ($p) => self::sanitizePath(trim($p)), explode(';', $paths)); }