diff --git a/lib/Db/TimelineWrite.php b/lib/Db/TimelineWrite.php index b57be324..598049ff 100644 --- a/lib/Db/TimelineWrite.php +++ b/lib/Db/TimelineWrite.php @@ -44,7 +44,8 @@ class TimelineWrite bool $force = false, ): bool { // 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; } diff --git a/lib/Service/Index.php b/lib/Service/Index.php index 91f1ee25..6c337c6b 100644 --- a/lib/Service/Index.php +++ b/lib/Service/Index.php @@ -146,6 +146,7 @@ class Index $query->select('f.fileid') ->from('filecache', 'f') ->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