Merge branch 'dev/default-timeline' of https://github.com/Murena-SAS/memories into Murena-SAS-dev/default-timeline

pull/837/head
Varun Patil 2023-09-29 10:34:16 -07:00
commit 6947ee9bc5
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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' => [],

View File

@ -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));
}