From 9904c0e5ff34f4280b09df4c6aed6b99f2893dea Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Dec 2008 03:37:09 +0000 Subject: Ignore resizes for albums when calculating the dirty count --- core/helpers/graphics.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/helpers') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index b0d5a08e..ee8e91ac 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -133,12 +133,14 @@ class graphics_Core { * */ public static function mark_all_dirty() { - Database::instance()->query("UPDATE `items` SET `thumb_dirty` = 1, `resize_dirty` = 1"); + $db = Database::instance(); + $db->query("UPDATE `items` SET `thumb_dirty` = 1, `resize_dirty` = 1"); - $count = ORM::factory("item") - ->where("thumb_dirty", 1) - ->orwhere("resize_dirty", 1) - ->count_all(); + $count = $db->query("SELECT COUNT(*) AS C FROM `items` " . + "WHERE `thumb_dirty` = 1 " . + " OR (`resize_dirty` = 1 AND `type` = 'photo')") + ->current() + ->C; if ($count) { message::warning( sprintf(_("%d of your photos are out of date. %sClick here to fix them%s"), -- cgit v1.2.3