From ab5e680265dfe9c42bd4d6fb8d1d9fccd95eed7b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 27 Sep 2009 20:31:56 -0700 Subject: Clean up the task initialization for rebuild thumbs and resizes. --- modules/gallery/helpers/gallery_task.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 3d0476a8..1ff26c35 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -48,11 +48,13 @@ class gallery_task_Core { $errors = array(); try { $result = graphics::find_dirty_images_query(); - $total_count = $task->get("total_count", -1); - if ($total_count < 0) { - $total_count = $result->count(); + $total_count = $task->get("total_count", $result->count()); + $mode = $task->get("mode", "init"); + if ($mode == "init") { $task->set("total_count", $total_count); + $task->get("mode", "process"); } + $completed = $task->get("completed", 0); $ignored = $task->get("ignored", array()); -- cgit v1.2.3