feat: build compact BO2 grind companion with cumulative ranks
Some checks failed
Test and deploy staging / staging (push) Failing after 2m50s
Some checks failed
Test and deploy staging / staging (push) Failing after 2m50s
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
trackerItems,
|
||||
trackerProgress
|
||||
} from '../src/lib/server/db/schema/game-tracker';
|
||||
import { trackerWeaponRanks } from '../src/lib/server/db/schema/tracker-journal';
|
||||
import type { MasteryRules } from '../src/lib/game-tracker/mastery';
|
||||
|
||||
type Catalog = {
|
||||
@@ -136,7 +137,16 @@ try {
|
||||
stale.map((item) => item.id)
|
||||
)
|
||||
);
|
||||
const keep = new Set(kept.map((row) => row.id));
|
||||
const ranked = await tx
|
||||
.select({ id: trackerWeaponRanks.itemId })
|
||||
.from(trackerWeaponRanks)
|
||||
.where(
|
||||
inArray(
|
||||
trackerWeaponRanks.itemId,
|
||||
stale.map((item) => item.id)
|
||||
)
|
||||
);
|
||||
const keep = new Set([...kept, ...ranked].map((row) => row.id));
|
||||
const remove = stale.filter((item) => !keep.has(item.id)).map((item) => item.id);
|
||||
if (remove.length) await tx.delete(trackerItems).where(inArray(trackerItems.id, remove));
|
||||
for (const item of stale.filter((item) => keep.has(item.id)))
|
||||
|
||||
Reference in New Issue
Block a user