mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08:24 +00:00
Phase 6: sync jobs, inquiry and order forms
- Sync scheduler in the content service with a per-job cache (sync_cache), sync_runs reporting and Healthchecks pings. Jobs: Archidekt, BoardGameGeek, cover art (Open Library, TMDB, AniList), Suwayomi and Kavita reading progress, Bambuddy filament and Homebox material stock. A note's own value always wins over a synced one. - PersonalReader: updates only Library notes with a matching anilistId, changes to Greg's notes are held for review; Reading series with no note show as suggestions on the admin Overview. - /api/inquiries and /api/orders: Turnstile, rate limits, a saved copy in the content service (intake token) plus email over SMTP. Orders are re-checked against the live notes: accepted only when the category's ordersOpen is true and the line has capacity. - Admin Inbox for saved submissions. Options' inStock is optional so synced stock can fill it. All settings from process.env; .env.example per service. - Sources could not be reached from the build environment; parsers are tested against fixtures labelled as not live. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
This commit is contained in:
@@ -91,6 +91,29 @@ export function statusesFor(s: SiteIndex, page: string) {
|
||||
/** Archidekt deck address. */
|
||||
export const archidektUrl = (id: number) => `https://archidekt.com/decks/${id}`;
|
||||
|
||||
/** Values Archidekt syncs onto a deck (see withSynced in content.ts). */
|
||||
interface DeckSynced {
|
||||
commanderArt?: string;
|
||||
colors?: string[];
|
||||
commanders?: string[];
|
||||
}
|
||||
|
||||
/** The deck's own cover, else its synced commander art. */
|
||||
export function deckArt(deck: Note<"deck">): string | undefined {
|
||||
const d = deck.data as DeckSynced & { cover?: string };
|
||||
return mediaSrc(d.cover ?? d.commanderArt);
|
||||
}
|
||||
|
||||
const COLOR_NAMES: Record<string, string> = { W: "White", U: "Blue", B: "Black", R: "Red", G: "Green" };
|
||||
|
||||
/** The deck's color identity as names, WUBRG order; empty when not synced. */
|
||||
export function deckColors(deck: Note<"deck">): string[] {
|
||||
return ((deck.data as DeckSynced).colors ?? []).map((c) => COLOR_NAMES[c]).filter((c): c is string => !!c);
|
||||
}
|
||||
|
||||
/** The deck's commanders, when synced. */
|
||||
export const deckCommanders = (deck: Note<"deck">): string[] => (deck.data as DeckSynced).commanders ?? [];
|
||||
|
||||
/** Deck's list address: Archidekt when set, else its own list link. */
|
||||
export function deckUrl(deck: Note<"deck">): string | undefined {
|
||||
return deck.data.archidektId ? archidektUrl(deck.data.archidektId) : deck.data.listUrl;
|
||||
|
||||
Reference in New Issue
Block a user