From a9b3b28d001941921aa70d37fdc87c758a163a44 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 05 Jun 2026 16:47:03 +0000
Subject: [PATCH] =Some hefty changes to FeedBlock. Transitioning to loading first page in php to save on extra requests. Got a bit to do yet, but I have to work on Northeh for a bit here.

---
 inc/managers/queue/executors/ContentExecutor.php |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/inc/managers/queue/executors/ContentExecutor.php b/inc/managers/queue/executors/ContentExecutor.php
index 3d5ef56..6b6aa1a 100644
--- a/inc/managers/queue/executors/ContentExecutor.php
+++ b/inc/managers/queue/executors/ContentExecutor.php
@@ -67,7 +67,7 @@
 	private function processContentUpdate(Operation $operation, array $data, Progress $progress): Result
 	{
 		$posts = $data['posts'] ?? [];
-
+		error_log('Processing Content Update: '.print_r($posts, true));
 		if (empty($posts)) {
 			return new Result(
 				outcome: 'success',
@@ -249,12 +249,7 @@
 			return [];
 		}
 
-		$children = get_children([
-			'post_parent' => $parentID,
-			'posts_per_page' => -1,
-			'post_status' => ['publish', 'draft'],
-		]);
-
+		$children = jvbTimelinePoints($parentID, $parent->post_type, ['publish', 'draft']);
 
 		if (count($children) === 0) {
 			return [];
@@ -348,6 +343,10 @@
 					}
 				}
 			}
+			$isUpdate = $meta->get('is_update');
+			if (!(bool) $isUpdate) {
+				$meta->set('number', $index);
+			}
 
 			if ($lastKey === $index) {
 				$latestTimestamp = strtotime($post->post_date);
@@ -461,11 +460,7 @@
 			$meta = Meta::forPost($parentID);
 			$values = $meta->getAll($shared);
 
-			$children = get_children([
-				'post_parent' => $parentID,
-				'posts_per_page' => -1,
-				'fields' => 'ids',
-			]);
+			$children = jvbTimelinePoints($parentID, get_post_type($parentID), ['any']);
 
 			if (empty($children)) {
 				continue;
@@ -484,11 +479,8 @@
 		});
 
 		foreach ($updates as $parentID => $status) {
-			$children = get_children([
-				'post_parent'	=> $parentID,
-				'posts_per_page' => -1,
-				'fields'	=> 'ids'
-			]);
+			$children = jvbTimelinePoints($parentID, get_post_type($parentID), ['any']);
+
 			if (!empty($children)) {
 				foreach($children as $child) {
 					if ($status === 'trash') {

--
Gitblit v1.10.0