diff options
author | Arne Hamann <git@arne.email> | 2022-04-24 17:49:58 +0300 |
---|---|---|
committer | Arne Hamann <git@arne.email> | 2022-04-24 17:49:58 +0300 |
commit | d9ed9cab7ae8fc6910ab58a77874f8d8be89ef48 (patch) | |
tree | ff2a08ddc8db47237f8d3475a41de990133c7e01 /lib | |
parent | 4c6c97cbda0096d465a954d6d2d22045e6d9a0ad (diff) |
Fixes #447
Signed-off-by: Arne Hamann <git@arne.email>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/PhotofilesService.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Service/PhotofilesService.php b/lib/Service/PhotofilesService.php index 228df73d..2f555e4d 100644 --- a/lib/Service/PhotofilesService.php +++ b/lib/Service/PhotofilesService.php @@ -74,11 +74,20 @@ class PhotofilesService { } } + public function checkForChanges($userId) { + $userFolder = $this->root->getUserFolder($userId); + $photos = $this->gatherPhotoFiles($userFolder, true); + $this->photoMapper->findAll($userId); + foreach ($photos as $photo) { + $this->addPhoto($photo, $userId); + yield $photo->getPath(); + } + } + // add the file for its owner and users that have access // check if it's already in DB before adding public function addByFile(Node $file) { $ownerId = $file->getOwner()->getUID(); - $userFolder = $this->root->getUserFolder($ownerId); if ($this->isPhoto($file)) { $this->addPhoto($file, $ownerId); // is the file accessible to other users ? @@ -108,8 +117,7 @@ class PhotofilesService { } public function addByFolderIdUserId($folderId, $userId) { - $userFolder = $this->root->getUserFolder($userId); - $folders = $userFolder->getById($folderId); + $folders = $this->root->getById($folderId); if (empty($folders)) { return; } |