diff --git a/lib/Controller/OtherController.php b/lib/Controller/OtherController.php index 9dbd140a..673779f6 100644 --- a/lib/Controller/OtherController.php +++ b/lib/Controller/OtherController.php @@ -81,6 +81,8 @@ class OtherController extends GenericApiController return $this->config->getUserValue($uid, Application::APPNAME, $key, $default); }; + $defaultTimelinePath = $this->config->getSystemValue('memories.default_timeline_path', 'EMPTY'); + return new JSONResponse([ // general stuff 'version' => $version, @@ -98,7 +100,7 @@ class OtherController extends GenericApiController 'preview_generator_enabled' => Util::previewGeneratorIsEnabled(), // general settings - 'timeline_path' => $getAppConfig('timelinePath', 'EMPTY'), + 'timeline_path' => $getAppConfig('timelinePath', $defaultTimelinePath), 'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'), // viewer settings diff --git a/lib/SystemConfigDefault.php b/lib/SystemConfigDefault.php index c15635fd..d5f3cbe6 100644 --- a/lib/SystemConfigDefault.php +++ b/lib/SystemConfigDefault.php @@ -70,6 +70,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..6cfc05a4 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 = self::getSystemConfig('memories.default_timeline_path'); + $paths = $config->getUserValue($uid, Application::APPNAME, 'timelinePath', null) ?? $defaultTimelinePath; return array_map(static fn ($p) => self::sanitizePath(trim($p)), explode(';', $paths)); }