summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/graphics.php12
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"),