Set default timeline path option

pull/833/head
Akhil 2023-09-26 20:08:54 +05:30
parent 2d6c62065e
commit 83ed204d9c
No known key found for this signature in database
GPG Key ID: A8AB680DBB7F3D45
2 changed files with 5 additions and 1 deletions

View File

@ -69,6 +69,9 @@ return [
// 1080 => 1080p (and so on) // 1080 => 1080p (and so on)
'memories.video_default_quality' => '0', '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 // Memories only provides an admin interface for these
// https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews // https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews
'enabledPreviewProviders' => [], 'enabledPreviewProviders' => [],

View File

@ -316,7 +316,8 @@ class Util
public static function getTimelinePaths(string $uid): array public static function getTimelinePaths(string $uid): array
{ {
$config = \OC::$server->get(IConfig::class); $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)); return array_map(static fn ($p) => self::sanitizePath(trim($p)), explode(';', $paths));
} }