koishi-plugin-echo-cave 1.29.12 → 1.29.13
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.
- package/lib/index.cjs +4 -4
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -35368,8 +35368,8 @@ function buildReindexPlan(caves) {
|
|
|
35368
35368
|
tempId: cave.id + offset
|
|
35369
35369
|
}));
|
|
35370
35370
|
}
|
|
35371
|
-
function
|
|
35372
|
-
return
|
|
35371
|
+
function hasSequentialPublicIds(caves) {
|
|
35372
|
+
return caves.every((cave, index) => cave.id === index + 1);
|
|
35373
35373
|
}
|
|
35374
35374
|
async function writeReindexBackup(backupDir, caves, mapping) {
|
|
35375
35375
|
await import_node_fs2.promises.mkdir(backupDir, { recursive: true });
|
|
@@ -35429,7 +35429,7 @@ async function reindexCaveIds(ctx, session, cfg) {
|
|
|
35429
35429
|
return session.text("commands.cave.admin.reindex.messages.noCaves");
|
|
35430
35430
|
}
|
|
35431
35431
|
const plan = buildReindexPlan(caves);
|
|
35432
|
-
if (
|
|
35432
|
+
if (hasSequentialPublicIds(caves)) {
|
|
35433
35433
|
return session.text("commands.cave.admin.reindex.messages.alreadySequential");
|
|
35434
35434
|
}
|
|
35435
35435
|
let backupPath;
|
|
@@ -35553,7 +35553,7 @@ async function runScheduledReindex(ctx, cfg) {
|
|
|
35553
35553
|
return;
|
|
35554
35554
|
}
|
|
35555
35555
|
const plan = buildReindexPlan(caves);
|
|
35556
|
-
if (
|
|
35556
|
+
if (hasSequentialPublicIds(caves)) {
|
|
35557
35557
|
ctx.logger.info("Skipped scheduled cave reindex because IDs are already sequential.");
|
|
35558
35558
|
return;
|
|
35559
35559
|
}
|