Match empty on "" and not just NULL

This commit is contained in:
Mikael Nordfeldth 2016-03-08 02:00:34 +01:00
parent 4360c65ed9
commit 4c7436e328

View File

@ -457,7 +457,7 @@ function deleteLocalFileThumbnailsWithoutFilename()
while ($file->fetch()) { while ($file->fetch()) {
$thumbs = new File_thumbnail(); $thumbs = new File_thumbnail();
$thumbs->file_id = $file->id; $thumbs->file_id = $file->id;
$thumbs->whereAdd('filename IS NULL'); $thumbs->whereAdd('filename IS NULL OR filename = ""');
// Checking if there were any File_thumbnail entries without filename // Checking if there were any File_thumbnail entries without filename
if (!$thumbs->find()) { if (!$thumbs->find()) {
continue; continue;
@ -480,7 +480,7 @@ function deleteMissingLocalFileThumbnails()
printfnq("Removing all local File_thumbnail entries without existing files..."); printfnq("Removing all local File_thumbnail entries without existing files...");
$thumbs = new File_thumbnail(); $thumbs = new File_thumbnail();
$thumbs->whereAdd('filename IS NOT NULL'); // only fill in names where they're missing $thumbs->whereAdd('filename IS NOT NULL AND filename != ""');
// Checking if there were any File_thumbnail entries without filename // Checking if there were any File_thumbnail entries without filename
if ($thumbs->find()) { if ($thumbs->find()) {
while ($thumbs->fetch()) { while ($thumbs->fetch()) {