Skip to content

Commit 43b9860

Browse files
authored
Update PhotofilesService.php
1 parent 5eba65a commit 43b9860

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/Service/PhotofilesService.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,18 @@ public function __construct (ILogger $logger,
7878
$this->backgroundJobCache = $this->cacheFactory->createDistributed('maps:background-jobs');
7979
}
8080

81-
public function rescan($userId, $inBackground=true) {
82-
$this->photosCache->clear($userId);
81+
public function rescanPath($userId, $pathToScan, $inBackground=true) {
8382
$userFolder = $this->root->getUserFolder($userId);
83+
if ($pathToScan !== null) {
84+
$userFolder = $userFolder->get($pathToScan);
85+
}
8486
$photos = $this->gatherPhotoFiles($userFolder, true);
85-
$this->photoMapper->deleteAll($userId);
8687
foreach ($photos as $photo) {
87-
if ($inBackground) {
88-
$this->addPhoto($photo, $userId);
89-
} else {
90-
$this->addPhotoNow($photo, $userId);
91-
}
88+
if ($inBackground) {
89+
$this->addPhoto($photo, $userId);
90+
} else {
91+
$this->addPhotoNow($photo, $userId);
92+
}
9293
yield $photo->getPath();
9394
}
9495
}

0 commit comments

Comments
 (0)