Name and scope every Scripture link, including the 24 on an older edition
Last tick left 547 Scripture links with no scope and 24 with no name. Both had a cause worth finding rather than papering over. ★ THE 547 WERE A PATCH THAT SILENTLY DID NOTHING. Two code paths create an eBible entry. The edit that added `ss` matched a string containing httpsify(ee.u); the second path reads `s: ee.u` without it, so the replacement found no match, reported success, and changed nothing. 523 entries kept a title and a full-Bible flag while losing their scope — a half-applied change is harder to see than a failed one, because every field you happen to check is present. That branch now sets every field the other branch sets. Scope coverage 690 -> 1,213. THE 24 POINT AT AN OLDER EDITION than the catalogue's current pick — tel2010 where the catalogue says tel2017, ben2006 where it says benobcv. BOTH RESOLVE, checked 8 of 8 at 200, so the curated choice is a choice and fill-never-overwrite keeps it. What was missing was only the description, and the language index cannot supply it: it answers "the best translation for this code", not "what is THIS link". The catalogue is now also indexed BY URL, 1,545 entries, so a link is described by the edition it actually points to. Telugu keeps ebible.org/tel2010/ and is now named "Telugu Easy Reading Version — Full Bible". RESULT: 1,237 of 1,237 Scripture links carry a real translation name and a scope. Zero rows still read "Scripture in this language". 840 New Testament, 251 Portions of both Testaments, 132 Full Bible, 14 Old Testament. The 2,311 blank scopes in the table reconcile exactly — 2,087 film, 121 Bible Stories and 103 Door43 Scripture entries, which are not eBible publications and have no book counts to scope. Blank there is the honest answer, not a gap. Verified: the scope line renders on a real group and is ABSENT on a group with no Scripture, so it still discriminates; coverage gate passes; pins, table and deep-link probes pass.
This commit is contained in:
parent
cc350514f3
commit
91dc9e6b33
11 changed files with 52 additions and 13 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -96,7 +96,12 @@ let d43 = {}
|
|||
try { d43 = JSON.parse(readFileSync(D43, 'utf8')).codes || {} } catch { d43 = {} }
|
||||
// eBible catalogue snapshot (scripts/fetch-ebible-index.mjs). Same optional contract.
|
||||
let eb = {}
|
||||
try { eb = JSON.parse(readFileSync(EBIBLE, 'utf8')).codes || {} } catch { eb = {} }
|
||||
let ebByUrl = {}
|
||||
try {
|
||||
const j = JSON.parse(readFileSync(EBIBLE, 'utf8'))
|
||||
eb = j.codes || {}
|
||||
ebByUrl = j.byUrl || {}
|
||||
} catch { eb = {}; ebByUrl = {} }
|
||||
// Arclight / JESUS Film snapshot (scripts/fetch-arclight-index.mjs).
|
||||
let arc = {}
|
||||
try { arc = JSON.parse(readFileSync(ARC, 'utf8')).codes || {} } catch { arc = {} }
|
||||
|
|
@ -132,8 +137,15 @@ for (const r of res) {
|
|||
// happens to be the same eBible page gets it too; one that points somewhere else does
|
||||
// NOT, because the catalogue's book counts would then be describing a different
|
||||
// publication. 643 entries were missing a scope purely because they were curated.
|
||||
...(ee && httpsify(s0 || ebUrl) === httpsify(ee.u)
|
||||
? { sv: ee.t || '', sf: ee.full ? 1 : 0, ss: scopeOf(ee) } : {}),
|
||||
// Identify the translation we ACTUALLY link to. Prefer the language index when the
|
||||
// URL is the catalogue's own pick; otherwise look the URL itself up, which names the
|
||||
// 24 curated links that point at an older edition than the catalogue's current
|
||||
// choice. Both resolve, so the curation is kept and only the description is added.
|
||||
...(() => {
|
||||
const url = httpsify(s0 || ebUrl)
|
||||
const hit = ee && url === httpsify(ee.u) ? ee : ebByUrl[url]
|
||||
return hit ? { sv: hit.t || '', sf: hit.full ? 1 : 0, ss: scopeOf(hit) } : {}
|
||||
})(),
|
||||
...((f || arcUrl) && { f: httpsify(f || arcUrl) }),
|
||||
// has_audio carries a meaningful third state: 'unknown' means a pool we could not
|
||||
// query (key-blocked), NOT a no. Collapsing it to a boolean would turn "we did not
|
||||
|
|
@ -182,7 +194,14 @@ for (const [c, ee] of Object.entries(eb)) {
|
|||
if (!codes[c].s) { codes[c].s = httpsify(ee.u); codes[c].sv = ee.t || ''; codes[c].sf = ee.full ? 1 : 0; codes[c].ss = scopeOf(ee) }
|
||||
continue
|
||||
}
|
||||
codes[c] = { l: ee.ln || '', s: ee.u, sv: ee.t || '', sf: ee.full ? 1 : 0, ck: 'ebible', un: 'arclight, grn, api_bible, dbl, progress_bible' }
|
||||
// ss and httpsify belong here as much as anywhere. A previous edit tried to add them
|
||||
// and matched a string this line did not contain, so the patch reported success and
|
||||
// changed nothing — 523 entries kept a title and a full-Bible flag while silently
|
||||
// losing their scope. Every field the other branch sets, this branch sets.
|
||||
codes[c] = {
|
||||
l: ee.ln || '', s: httpsify(ee.u), sv: ee.t || '', sf: ee.full ? 1 : 0, ss: scopeOf(ee),
|
||||
ck: 'ebible', un: 'arclight, grn, api_bible, dbl, progress_bible',
|
||||
}
|
||||
ebOnly++
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,25 @@ for (const r of rows) {
|
|||
}
|
||||
stats.kept = Object.keys(best).length
|
||||
|
||||
// ALSO KEYED BY URL. The language index answers "what is the best translation for this
|
||||
// code"; it cannot answer "what is THIS link". 24 curated scripture_urls point at an
|
||||
// older edition than the catalogue's current pick — tel2010 where the catalogue says
|
||||
// tel2017 — and both resolve, so the curated choice is kept. Indexed by URL they can
|
||||
// still be NAMED and SCOPED, instead of being the only rows on the map with no scope.
|
||||
const byUrl = {}
|
||||
for (const r of rows) {
|
||||
const url = httpsify(r.publicationURL || '')
|
||||
const host = (url.match(/^https?:\/\/([^/]+)/) || [])[1]
|
||||
if (!url || !host || !ALLOWED.has(host)) continue
|
||||
const ot = num(r.OTbooks), nt = num(r.NTbooks)
|
||||
if (ot + nt === 0) continue
|
||||
byUrl[url] = {
|
||||
t: (r.shortTitle || r.title || '').trim(),
|
||||
ln: (r.languageNameInEnglish || r.languageName || '').trim(),
|
||||
nt: nt > 0, ot: ot > 0, full: ot >= 39 && nt >= 27,
|
||||
}
|
||||
}
|
||||
|
||||
const out = {
|
||||
_note: 'eBible.org translation catalogue, keyed by ISO 639-3. One translation per language (most canonical books). Rows with no OT/NT books are dropped; publication domains are allow-listed after a doctrine screen. inscript.org excluded: no established provenance.',
|
||||
generated: new Date().toISOString().slice(0, 10),
|
||||
|
|
@ -123,6 +142,7 @@ const out = {
|
|||
allowed_domains: [...ALLOWED],
|
||||
stats,
|
||||
codes: best,
|
||||
byUrl,
|
||||
}
|
||||
writeFileSync(OUT, JSON.stringify(out))
|
||||
console.log(JSON.stringify(stats))
|
||||
|
|
|
|||
2
public/assets/tables/ebible-index.json
vendored
2
public/assets/tables/ebible-index.json
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/assets/tables/people-group-pins.json
vendored
2
public/assets/tables/people-group-pins.json
vendored
File diff suppressed because one or more lines are too long
2
public/doxa-maps/assets/tables/ebible-index.json
generated
2
public/doxa-maps/assets/tables/ebible-index.json
generated
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue