diff options
Diffstat (limited to 'modules/g2_import/helpers/g2_import_task.php')
-rw-r--r-- | modules/g2_import/helpers/g2_import_task.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 161f0709..4cd95581 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -47,6 +47,7 @@ class g2_import_task_Core { $stats["items"] = $stats["photos"] + $stats["movies"]; unset($stats["photos"]); unset($stats["movies"]); + $stats["highlights"] = $stats["albums"]; $task->set("stats", $stats); $task->set("total", $total = array_sum(array_values($stats))); @@ -68,7 +69,7 @@ class g2_import_task_Core { } } - $modes = array("groups", "users", "albums", "items", "comments", "tags", "done"); + $modes = array("groups", "users", "albums", "items", "comments", "tags", "highlights", "done"); while (!$task->done && microtime(true) - $start < 1.5) { if ($done[$modes[$mode]] == $stats[$modes[$mode]]) { // Nothing left to do for this mode. Advance. @@ -152,6 +153,17 @@ class g2_import_task_Core { break; + case "highlights": + if (empty($queue)) { + $task->set("queue", $queue = g2(GalleryCoreApi::fetchAlbumTree())); + } + g2_import::set_album_highlight($queue); + $task->status = t( + "Album highlights (%count of %total)", + array("count" => $done["tags"] + 1, "total" => $stats["albums"])); + + break; + case "done": $task->status = t("Import complete"); $task->done = true; |