add Genshin Impact Fandom event source
Add genshin-impact.fandom.com as a second source for Genshin Impact, which has been fixture-backed in CI because Game8 CloudFront-blocks the Actions runner with 202s. - Add fifth Fandom template parser in src/ingest/parsers/fandom.ts extracting titles from caption display text, stripping dated subpage suffixes, and checking currency via latestBoundaryMs. - Register genshin-fandom-events in src/ingest/adapters/index.ts and set genshin-game8-events priority: 10 so existing event IDs survive near-match ties, preventing localStorage completion marks from orphaning. - Explicitly sort adapter groups by priority descending in scripts/build-feed.ts to align with parseGame. - Pin fixtures and add test coverage in test/adapters/game8.test.ts. - Update AGENTS.md, README.md, docs/INGESTION.md, and docs/SOURCES.md.
This commit is contained in:
@@ -58,7 +58,7 @@ async function documentFor(adapterId: string, game: GameId) {
|
||||
}
|
||||
|
||||
const now = new Date().toISOString();
|
||||
const byGame = new Map<GameId, GachaEvent[][]>();
|
||||
const byGame = new Map<GameId, Array<{ priority: number; events: GachaEvent[] }>>();
|
||||
const sources: SourceHealth[] = [];
|
||||
|
||||
for (const adapter of ADAPTERS) {
|
||||
@@ -76,7 +76,7 @@ for (const adapter of ADAPTERS) {
|
||||
const { parsedCount } = health;
|
||||
|
||||
const groups = byGame.get(adapter.game) ?? [];
|
||||
groups.push(events);
|
||||
groups.push({ priority: adapter.priority, events });
|
||||
byGame.set(adapter.game, groups);
|
||||
|
||||
sources.push(health);
|
||||
@@ -96,7 +96,10 @@ for (const adapter of ADAPTERS) {
|
||||
const events: GachaEvent[] = [];
|
||||
let conflictCount = 0;
|
||||
for (const [, groups] of byGame) {
|
||||
const merged = mergeEvents(groups);
|
||||
const sorted = groups
|
||||
.sort((a, b) => b.priority - a.priority)
|
||||
.map((g) => g.events);
|
||||
const merged = mergeEvents(sorted);
|
||||
events.push(...merged.events);
|
||||
conflictCount += merged.conflicts.length;
|
||||
for (const c of merged.conflicts) {
|
||||
|
||||
Reference in New Issue
Block a user