fixes #2198 smarter way to deal with filesize bounds

This commit is contained in:
plegall
2024-08-02 17:47:45 +02:00
parent 6fb86d25bf
commit 8c4b3fb7db
3 changed files with 10 additions and 11 deletions
+3 -1
View File
@@ -416,7 +416,9 @@ SELECT
if (!empty($search['fields']['filesize_min']) && !empty($search['fields']['filesize_max']))
{
$clauses[] = 'filesize BETWEEN '.$search['fields']['filesize_min'].' AND '.$search['fields']['filesize_max'];
// because of conversion from kB to mB, approximation, then conversion back to kB,
// we need to slightly enlarge the range for search
$clauses[] = 'filesize BETWEEN '.($search['fields']['filesize_min']-100).' AND '.($search['fields']['filesize_max']+100);
}
if (!empty($search['fields']['height_min']) && !empty($search['fields']['height_max']))