tw: do not attempt to index zero-byte files (close #933)
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/953/head
parent
eb784ef8ab
commit
ff912a6bee
|
@ -44,7 +44,8 @@ class TimelineWrite
|
||||||
bool $force = false,
|
bool $force = false,
|
||||||
): bool {
|
): bool {
|
||||||
// Check if we want to process this file
|
// Check if we want to process this file
|
||||||
if (!Index::isSupported($file)) {
|
// https://github.com/pulsejet/memories/issues/933 (zero-byte files)
|
||||||
|
if ($file->getSize() <= 0 || !Index::isSupported($file)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,7 @@ class Index
|
||||||
$query->select('f.fileid')
|
$query->select('f.fileid')
|
||||||
->from('filecache', 'f')
|
->from('filecache', 'f')
|
||||||
->where($query->expr()->in('f.fileid', $query->createNamedParameter($fileIds, IQueryBuilder::PARAM_INT_ARRAY)))
|
->where($query->expr()->in('f.fileid', $query->createNamedParameter($fileIds, IQueryBuilder::PARAM_INT_ARRAY)))
|
||||||
|
->andWhere($query->expr()->gt('f.size', $query->expr()->literal(0)))
|
||||||
;
|
;
|
||||||
|
|
||||||
// Filter out files that are already indexed
|
// Filter out files that are already indexed
|
||||||
|
|
Loading…
Reference in New Issue