File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -78,17 +78,18 @@ public function __construct (ILogger $logger,
78
78
$ this ->backgroundJobCache = $ this ->cacheFactory ->createDistributed ('maps:background-jobs ' );
79
79
}
80
80
81
- public function rescan ($ userId , $ inBackground =true ) {
82
- $ this ->photosCache ->clear ($ userId );
81
+ public function rescanPath ($ userId , $ pathToScan , $ inBackground =true ) {
83
82
$ userFolder = $ this ->root ->getUserFolder ($ userId );
83
+ if ($ pathToScan !== null ) {
84
+ $ userFolder = $ userFolder ->get ($ pathToScan );
85
+ }
84
86
$ photos = $ this ->gatherPhotoFiles ($ userFolder , true );
85
- $ this ->photoMapper ->deleteAll ($ userId );
86
87
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
+ }
92
93
yield $ photo ->getPath ();
93
94
}
94
95
}
You can’t perform that action at this time.
0 commit comments