abmp-npm 1.1.137 → 1.1.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,14 +28,13 @@ async function ensureUniqueUrlsInBatch(memberDataList) {
|
|
|
28
28
|
const baseUrl = extractBaseUrl(member.url);
|
|
29
29
|
const groupKey = baseUrl.toLowerCase();
|
|
30
30
|
if (!urlGroups.has(groupKey)) {
|
|
31
|
-
urlGroups.set(groupKey, []);
|
|
31
|
+
urlGroups.set(groupKey, { members: [], baseUrl });
|
|
32
32
|
}
|
|
33
|
-
urlGroups.get(groupKey).push(member);
|
|
33
|
+
urlGroups.get(groupKey).members.push(member);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
// For each group, check database and assign unique URLs sequentially
|
|
37
|
-
for (const [
|
|
38
|
-
const baseUrl = groupKey; // lowercase for consistent slug assignment
|
|
37
|
+
for (const [, { members, baseUrl }] of urlGroups.entries()) {
|
|
39
38
|
if (members.length <= 1) {
|
|
40
39
|
// Single member - still check DB to ensure it doesn't conflict with other pages
|
|
41
40
|
const member = members[0];
|
|
@@ -77,8 +76,7 @@ async function ensureUniqueUrlsInBatch(memberDataList) {
|
|
|
77
76
|
// Find the highest existing counter among all members in this batch group
|
|
78
77
|
let batchMaxCounter = -1;
|
|
79
78
|
members.forEach(member => {
|
|
80
|
-
const
|
|
81
|
-
const urlCounter = extractUrlCounter(originalUrl);
|
|
79
|
+
const urlCounter = extractUrlCounter(member.url);
|
|
82
80
|
if (urlCounter > batchMaxCounter) {
|
|
83
81
|
batchMaxCounter = urlCounter;
|
|
84
82
|
}
|