fix(wildlife): point the Acartia card link only at acartia.io

The card's "Acartia" link was built from the contributor-supplied
photo_url, so any https site could appear labelled as Acartia. Acartia
has no documented per-sighting page, so the source link is now always
the Acartia site, on the server projection and again in the card.
The separate "Open on Acartia" fallback link is no longer needed.
This commit is contained in:
Sameh Khamis committed 2026-11-05 16:05:02 -08:00
1 parent 82138478d0
commit 3cb30c3f97
16 files changed
+45 -29

No files matched your search

+4 -13
View File
@@ -247,18 +247,9 @@ export function normalizeInatObservations(
return rows;
}
function acartiaLink(value) {
if (typeof value !== 'string' || value.length > 500)
return 'https://acartia.io';
try {
const url = new URL(value);
return url.protocol === 'https:' && !url.username && !url.password
? url.href
: 'https://acartia.io';
} catch {
return 'https://acartia.io';
}
}
// Acartia has no documented per-sighting page, and photo_url is supplied by the
// contributor. The source link is therefore always the Acartia site itself.
export const ACARTIA_SITE = 'https://acartia.io/';
/** Acartia documents flat rows only. Name and entity are text fields; unknown
* shapes are skipped rather than guessing nested provider data. */
@@ -315,7 +306,7 @@ export function normalizeAcartiaSightings(payload, nowMs) {
cetacean: speciesGroup === 'cetacean',
threatened: false,
provider: { name, entity: cleanText(raw.data_source_entity, 60) },
link: acartiaLink(raw.photo_url),
link: ACARTIA_SITE,
photo: null,
favesCount: 0,
identificationAgreements: 0,