Skip to content

Commit 6f98651

Browse files
authored
Merge pull request #28610 from nextcloud/enh/preview-cleanup-query
2 parents 66ca9ba + 0670118 commit 6f98651

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/private/Files/AppData/AppData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private function getAppDataFolderName() {
7979
return 'appdata_' . $instanceId;
8080
}
8181

82-
private function getAppDataRootFolder(): Folder {
82+
protected function getAppDataRootFolder(): Folder {
8383
$name = $this->getAppDataFolderName();
8484

8585
try {

lib/private/Preview/BackgroundCleanupJob.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ private function getNewPreviewLocations(): \Iterator {
134134
))
135135
->where(
136136
$qb->expr()->andX(
137+
$qb->expr()->eq('a.storage', $qb->createNamedParameter($this->previewFolder->getStorageId())),
137138
$qb->expr()->isNull('b.fileid'),
138139
$qb->expr()->like('a.path', $qb->createNamedParameter($like)),
139140
$qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory')))

lib/private/Preview/Storage/Root.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ public function getDirectoryListing(): array {
8585
public static function getInternalFolder(string $name): string {
8686
return implode('/', str_split(substr(md5($name), 0, 7))) . '/' . $name;
8787
}
88+
89+
public function getStorageId(): int {
90+
return $this->getAppDataRootFolder()->getStorage()->getCache()->getNumericStorageId();
91+
}
8892
}

0 commit comments

Comments
 (0)