From d756d13d69c51d553691ba77549a0a5b13e77850 Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 17 Oct 2026 14:00:27 +0000 Subject: [PATCH 1/5] Delivery (FPA): use short team codes in Nextcloud folder and file names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The FPA destination preset built the game folder and file name from the full team names ({home} x {away}), e.g. "Vitória SC x AA Águas Santas". FPA expects the short codes ("VSC x AAAS"). Switch the FPA folder and fileName templates to {homeShort} x {awayShort}. Safe by construction: buildVars sets homeShort/awayShort with a `?? home` fallback, so when an event has no short code the segment is the full name (never empty, never a missing-variable error). Liga keeps full names on purpose ("1. Casa Pia x Sporting"), so its preset is unchanged. Test: the FPA fixture now uses distinct full names + short codes, proving the template renders the short code rather than the full name. Claude-Session: https://claude.ai/code/session_01RAkmwWv6L5KmpX4h9JPD2i --- packages/metadata/src/metadata.test.ts | 6 ++++-- packages/metadata/src/paths.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/metadata/src/metadata.test.ts b/packages/metadata/src/metadata.test.ts index 7b3d223..2845c7f 100644 --- a/packages/metadata/src/metadata.test.ts +++ b/packages/metadata/src/metadata.test.ts @@ -138,8 +138,10 @@ describe("vars", () => { describe("delivery paths", () => { const vsc = buildVars({ - home: "VSC", - away: "AAAS", + home: "Vitória SC", + away: "AA Águas Santas", + homeShort: "VSC", + awayShort: "AAAS", competition: "Campeonato Betclic", competitionCode: "PO01", startsAt: new Date("2026-09-23T19:00:00Z"), diff --git a/packages/metadata/src/paths.ts b/packages/metadata/src/paths.ts index 9c79af4..f37f914 100644 --- a/packages/metadata/src/paths.ts +++ b/packages/metadata/src/paths.ts @@ -68,8 +68,8 @@ export function renderFileName(template: string, vars: TemplateVars, originalFil /** Example destination rules taken from today's deliveries. */ export const DESTINATION_EXAMPLES = { fpa: { - folder: "/FPA/Fotos/{season}/Competições Nacionais/{competitionCode} - {competition}/{dateCompact} - {home} x {away}/", - fileName: "PS_{home} x {away}_{n}.jpg", + folder: "/FPA/Fotos/{season}/Competições Nacionais/{competitionCode} - {competition}/{dateCompact} - {homeShort} x {awayShort}/", + fileName: "PS_{homeShort} x {awayShort}_{n}.jpg", }, liga: { folder: "/LPBetclic {seasonShort}/Jornada {round}/{matchNumber}. {home} x {away}/", From 03df893e34216327e8bbfa6aa454ca43075bcb4c Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 17 Oct 2026 14:03:29 +0000 Subject: [PATCH 2/5] Library: keep the grid loading reliably and never show a silent blank tile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two causes of the "half-loaded" grid where some READY photos stay grey: 1. cachedImage fetched thumbnails with no timeout, inside a 6-slot concurrency limiter. A single stalled request (busy server, dropped connection) held its slot forever and starved every queued tile, so the rest of the grid never loaded. Download now runs through an AbortController that aborts after 20s, freeing the slot so the queue keeps moving; the stalled photo falls back to loading its URL directly instead of blocking the others. 2. The grid cell rendered `shown && ` with no onError and no fallback, so a pending or failed image was an indistinguishable grey blank. A READY photo now shows "…" while its thumbnail is still resolving and "erro" if the image fails to load (onError), mirroring the loupe's resilience. UI/cache only; no API or data changes. Claude-Session: https://claude.ai/code/session_01RAkmwWv6L5KmpX4h9JPD2i --- apps/app/src/library/Grid.tsx | 10 +++++++++- apps/app/src/offline/cache.ts | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/app/src/library/Grid.tsx b/apps/app/src/library/Grid.tsx index f85d65d..3797519 100644 --- a/apps/app/src/library/Grid.tsx +++ b/apps/app/src/library/Grid.tsx @@ -31,6 +31,8 @@ const Cell = memo(function Cell({ photo, index, src, selected, focused, onPick, const label = LABEL_COLOR[photo.colorLabel]; // Desktop app: thumbnails are kept on the computer, so the grid shows without a network. const shown = useCachedImage(src, isDesktop()); + const [imgFailed, setImgFailed] = useState(false); + useEffect(() => setImgFailed(false), [shown]); return ( + {pickOpen && ( +
+ {targets.map((x) => ( + + ))} +
+ )} + )} )}