2022-08-20 02:53:21 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\Memories;
|
|
|
|
|
|
|
|
use OCA\Memories\AppInfo\Application;
|
|
|
|
use OCP\IConfig;
|
|
|
|
|
|
|
|
class Util {
|
2022-09-16 21:37:52 +00:00
|
|
|
public static $TAG_DAYID_START = -(1 << 30); // the world surely didn't exist
|
|
|
|
public static $TAG_DAYID_FOLDERS = -(1 << 30) + 1;
|
|
|
|
|
2022-09-25 23:02:26 +00:00
|
|
|
public static $ARCHIVE_FOLDER = '.archive';
|
|
|
|
|
2022-08-20 02:53:21 +00:00
|
|
|
/**
|
|
|
|
* Get the path to the user's configured photos directory.
|
|
|
|
* @param IConfig $config
|
|
|
|
* @param string $userId
|
|
|
|
*/
|
2022-09-10 22:31:11 +00:00
|
|
|
public static function getPhotosPath(IConfig &$config, string $userId) {
|
2022-08-20 02:53:21 +00:00
|
|
|
$p = $config->getUserValue($userId, Application::APPNAME, 'timelinePath', '');
|
|
|
|
if (empty($p)) {
|
|
|
|
return '/Photos/';
|
|
|
|
}
|
|
|
|
return $p;
|
|
|
|
}
|
|
|
|
}
|