Skip to content

Commit ccb5d6b

Browse files
ata-no-onedoxthree
authored andcommitted
Fix Error "File with ID xyz not found, skipping: " while scanning groupfolder versions during #255
1 parent a4f96da commit ccb5d6b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Db/DbFileMapper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function getFileIdsWithoutTags(array $excludedTagIds, int $limit, int $of
6969
$qb->expr()->like('f.path', $qb->createNamedParameter('files/%')),
7070
$qb->expr()->like('f.path', $qb->createNamedParameter('__groupfolders/%'))
7171
))
72+
->andWhere($qb->expr()->notLike('f.path', $qb->createNamedParameter('__groupfolders/versions/%')))
7273
->orderBy('f.fileid', 'DESC')
7374
->setFirstResult($offset)
7475
->setMaxResults($limit);
@@ -107,6 +108,7 @@ public function getFileIdsWithTags(array $includedTagIds, int $limit, int $offse
107108
$qb->expr()->like('f.path', $qb->createNamedParameter('files/%')),
108109
$qb->expr()->like('f.path', $qb->createNamedParameter('__groupfolders/%'))
109110
))
111+
->andWhere($qb->expr()->notLike('f.path', $qb->createNamedParameter('__groupfolders/versions/%')))
110112
->orderBy('f.fileid', 'DESC')
111113
->setFirstResult($offset)
112114
->setMaxResults($limit);
@@ -138,7 +140,9 @@ public function getFilesCount(): int {
138140
->andWhere($fileQuery->expr()->orX(
139141
$fileQuery->expr()->like('f.path', $fileQuery->createNamedParameter('files/%')),
140142
$fileQuery->expr()->like('f.path', $fileQuery->createNamedParameter('__groupfolders/%'))
141-
));
143+
))
144+
->andWhere($fileQuery->expr()->notLike('f.path', $fileQuery->createNamedParameter('__groupfolders/versions/%')));
145+
142146

143147
$storageQuery = $this->db->getQueryBuilder();
144148
$storageQuery->selectAlias('numeric_id', 'id')

lib/Service/ScanService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function getFileIdsToScan(): array {
132132
$this->logger->debug("File with ID $fileId is not readable or not allowed to scan, skipping.");
133133
}
134134
} catch (NotFoundException $e) {
135-
$this->logger->error("File with ID $fileId not found, skipping: " . $e->getMessage());
135+
$this->logger->error("File with ID $fileId not found, skipping: " . $e->getMessage(), ['exception' => $e]);
136136
} catch (NotPermittedException $e) {
137137
$this->logger->error(
138138
"Current settings do not permit scanning file with ID $fileId, skipping: " . $e->getMessage()

0 commit comments

Comments
 (0)