diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-27 03:37:09 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-27 03:37:09 +0000 |
commit | 9904c0e5ff34f4280b09df4c6aed6b99f2893dea (patch) | |
tree | d4bbb962eb19eff93530e43c805d6ef4e969f7f0 /core/helpers | |
parent | f808dd9d01c2c72779177438a8339af9d2544365 (diff) |
Ignore resizes for albums when calculating the dirty count
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/graphics.php | 12 |
1 files changed, 7 insertions, 5 deletions
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"), |