tracker
All repositories: gitoria
26.6 KB
// lib/franchises.hl — FRANCHISES AND TIMELINES (tracker.worldapi.org#19, mission 066). The creator: "we have franchises, and// timelines, and some franchises have multiple timelines ... make them sortable by timeline or release date at shows the// release date of the last episode counts. in a show or movie page we show a franchise widget with < Prequel | TimelineName// | Sequel > and if the timeline is part of a franchise that franchise is above it and when you click on it you get the// franchise index."//// franchisesTable pk @id index !slug { name, slug, shortId (null: not given out yet), summary, created }// timelinesTable pk @id index !slug { name, slug, franchise (@id | null), order [show @id …], source ('tmdb' |// 'editor' | 'seed'), tmdbCollection (TMDB collection id | null), orderKind// ('in-universe' | 'release' | null: not said, tracker#40), supersededBy (@id | null),// created }// storage/mpackdb/{franchises,timelines}.db (new tables; nothing in shows.db changes; the seed's collectionchecks.db is// collections.hl's, the curated seed's franchiseseed.db franchiseseed.hl's)//// A TITLE MAY BE IN SEVERAL TIMELINES (Star Trek Prime and Kelvin, or a TMDB collection and a hand-made one): `byShow` (show// @id → [timeline @id]) is built once at start (`ensureFranchises`, one scan of the timelines) and kept up to date by every// edit — the show page's widget reads only its own timelines, never all of them.//// THE ORDER of a timeline is its in-world order (`order`, editable). The pages can sort it by RELEASE instead: a movie by its// `release`, a SERIES by the release date of its LAST episode (the newest one already out; none out yet → the newest// announced one; no episode dates at all → the series' own `release`). Titles without any date go last.//// SUPERSEDED (tracker#40): a TMDB collection timeline whose every title is in ONE curated (seed) timeline is hidden — no widget,// not on /franchises or a franchise's index — but kept (its own page and the editor's finder still reach it): `supersededBy` =// that curated timeline. Set by the collection seed when it makes one (collections.hl) and by the curated seed's build// (franchiseseed.hl), which also lifts it when the cover is gone; `seededCoverOf` decides.//// PUBLIC LIKE THE OTHER LISTS (mission 054): the pages and the widget's prequel/sequel links show only titles with// `adult == false` (shows.hl isPublicTitle); the order keeps them, they are just skipped.//// THE SEEDS: TMDB movie collections → timelines (collections.hl); the curated franchises of data/franchises.json, movies AND// series (franchiseseed.hl, tracker#40) — both write through the functions here.//// ONE PROCESS PER STORAGE (hybriel#21): the tables are opened here, in the app's process only.import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'import { now } from 'hl:time'import { storageDir, newId, todayStr, dateOr, firstOf, textArg } from './util.hl'import { showById, seasonsOfShow, episodesOfSeason, titleWithYear, posterUrlOf, isPublicTitle, titlePath, pillClassOfWord } from './shows.hl'import { userOfSession } from './users.hl'import { dbSearch } from './search.hl'import { slugBaseOf } from './search-helpers.hl'import { pageNumberOf } from './catalog.hl'static franchisesTable = new MPackDB(file = storageDir + '/franchises.db', primaryKey = '@id', indexes = ['!slug'])static timelinesTable = new MPackDB(file = storageDir + '/timelines.db', primaryKey = '@id', indexes = ['!slug'])// a name as typed: trimmed, null when there is none (the editor's names and summaries)static trimmedOr = (&v) => { return v != null && hlTypeName(v) == 'String' && v.trim() != '' ? v.trim() : null }// ---- who may edit: the creator (ident short id az5b2); TRACKER_EDITORS = a comma list of ident ids (the gate sets its own) ----static editorIds = () => {v = env('TRACKER_EDITORS')raw = v != null && v.trim() != '' ? v : 'az5b2'out = []for (p of raw.split(',')) { if (p.trim() != '') { out.push(p.trim()) } }return out}static editors = editorIds()static isEditorSession = (&session) => {if (session == null || hlTypeName(session) != 'Instance') { return false }u = userOfSession(&session)return u != null && u.identity != null && editors.includes(u.identity)}// a list's index of x, -1 when it is not in it (hand-written: list helpers beyond includes/push are not trusted, hybriel#1)static posOf = (&list, &x) => {let i = 0while (i < list.length) {if (list[i] == x) { return i }i = i + 1}return -1}// ---- slugs: "Star Trek" → "Star-Trek" (the shows' urlSegment form, search-helpers.hl slugBaseOf; none → 'timeline') -------static freeSlug = (&table, &name) => {base = slugBaseOf(&name, 'timeline')// 'edit' is the editor's own address (/franchises/edit)if (firstOf(table.find('slug', base)) == null && base != 'edit') { return base }let n = 2while (firstOf(table.find('slug', base + '-' + n)) != null) { n = n + 1 }return base + '-' + n}static franchiseBySlug = (&slug) => {if (slug == null || hlTypeName(slug) != 'String' || slug == '') { return null }return firstOf(franchisesTable.find('slug', slug))}static timelineBySlug = (&slug) => {if (slug == null || hlTypeName(slug) != 'String' || slug == '') { return null }return firstOf(timelinesTable.find('slug', slug))}static franchiseById = (&id) => { return id == null || hlTypeName(id) != 'String' || id == '' ? null : franchisesTable.fetch(id) }static timelineById = (&id) => { return id == null || hlTypeName(id) != 'String' || id == '' ? null : timelinesTable.fetch(id) }// ---- byShow: show @id → [timeline @id] ------------------------------------------------------------------------------------static byShow = {}static state = { built = false timelines = 0 ms = 0 }static indexAdd = (&showId, &timelineId) => {let l = byShow[showId]if (l == null) { l = [] }if (!l.includes(timelineId)) { l.push(timelineId) }byShow[showId] = lreturn true}static indexRemove = (&showId, &timelineId) => {l = byShow[showId]if (l == null) { return true }out = []for (x of l) { if (x != timelineId) { out.push(x) } }byShow[showId] = outreturn true}static ensureFranchises = () => {if (state.built) { return true }state.built = truet0 = now()let n = 0for (t of timelinesTable.iterate(null, null)) {n = n + 1if (t.order != null) { for (sid of t.order) { indexAdd(&sid, &t.id) } }}state.timelines = nstate.ms = now() - t0console.log('franchises: ' + n + ' timelines, ' + franchisesTable.count() + ' franchises (' + state.ms + ' ms)')return true}static timelineIdsOfShow = (&showId) => {ensureFranchises()l = byShow[showId]return l != null ? l : []}// ---- a title as the pages list it ------------------------------------------------------------------------------------------// the date the release sort uses: a movie's release; a series' LAST episode (newest out ≤ today, else newest announced, else// its own release)static releaseKeyOf = (&show) => {if (show.type != 'series') { return dateOr(&show.release) }today = todayStr()let lastOut = ''let lastAny = ''for (s of seasonsOfShow(&show)) {for (e of episodesOfSeason(&s)) {d = dateOr(&e.release)if (d != '') {if (d > lastAny) { lastAny = d }if (d <= today && d > lastOut) { lastOut = d }}}}if (lastOut != '') { return lastOut }if (lastAny != '') { return lastAny }return dateOr(&show.release)}static itemOf = (&show, pos) => {series = show.type == 'series'd = releaseKeyOf(&show)label = d == '' ? 'no date' : (series ? 'last episode ' + d : d)return { id = show.id pos = pos title = titleWithYear(&show) href = titlePath(&show) posterUrl = posterUrlOf(&show)kind = series ? 'Series' : 'Movie' date = d dateLabel = label }}// the public titles of a timeline, in its order (`pos` = the place in the in-world order, 1-based)static itemsOf = (&t) => {out = []let pos = 0if (t.order == null) { return out }for (sid of t.order) {s = showById(&sid)if (s != null && isPublicTitle(&s)) {pos = pos + 1out.push(itemOf(&s, pos))}}return out}// release order: oldest first, no date last; equal dates keep the timeline order (a stable insertion)static byReleaseOf = (&items) => {let out = []for (it of items) {next = []let done = falsefor (x of out) {if (!done && it.date != '' && (x.date == '' || it.date < x.date)) { next.push(it) done = true }next.push(x)}if (!done) { next.push(it) }out = next}return out}// tracker#40: what the timeline's own order is, said beside its count ("23 titles · in-universe order"); none when not knownstatic orderNoteOf = (&t) => {if (t.orderKind == 'in-universe') { return ' · in-universe order' }if (t.orderKind == 'release') { return ' · release order' }return ''}static blockOf = (&t) => {items = itemsOf(&t)return { id = t.id name = t.name slug = t.slug href = '/timelines/' + t.slug items = items byRelease = byReleaseOf(&items)countText = (items.length == 1 ? '1 title' : items.length + ' titles') + orderNoteOf(&t) first = items.length > 0 ? byReleaseOf(&items)[0].date : '' }}// ---- the pages -------------------------------------------------------------------------------------------------------------// /franchises: every franchise (name, how many timelines), then the timelines WITHOUT one (TMDB's collections, by name)// by name (sortName), a stable bottom-up MERGE sort: the insertion sort this replaced took 2.3 s for the 1,546 collection timelines of the// real data (mobile audit MK: /franchises took 20 s), this one 50 msstatic mergeByName = (&a, &b) => {out = []let i = 0let j = 0while (i < a.length && j < b.length) {if (b[j].sortName < a[i].sortName) { out.push(b[j]) j = j + 1 } else { out.push(a[i]) i = i + 1 }}while (i < a.length) { out.push(a[i]) i = i + 1 }while (j < b.length) { out.push(b[j]) j = j + 1 }return out}static byNameOf = (&rows) => {if (rows.length < 2) { return rows }let runs = []for (r of rows) { runs.push([r]) }while (runs.length > 1) {next = []let k = 0while (k < runs.length) {if (k + 1 < runs.length) { next.push(mergeByName(&runs[k], runs[k + 1])) } else { next.push(runs[k]) }k = k + 2}runs = next}return runs[0]}// how many timelines without a franchise one page of /franchises lists (mobile audit MK: all 1,546 at once were a 54,000 px page, 633 KB, 20 s)static timelinePageSize = 40static timelinePagesOf = (&count) => {let p = 1while (p * timelinePageSize < count) { p = p + 1 }return p}static franchiseIndex = () => {counts = {}loose = []for (t of timelinesTable.iterate(null, null)) {let n = t.order != null ? t.order.length : 0// tracker#40: a superseded collection timeline is not listed (nor counted for its franchise)if (t.supersededBy != null) { n = 0 }else if (t.franchise != null && t.franchise != '') { counts[t.franchise] = (counts[t.franchise] != null ? counts[t.franchise] : 0) + 1 }else if (n > 0) { loose.push({ id = t.id name = t.name href = '/timelines/' + t.slug countText = n == 1 ? '1 title' : n + ' titles' sortName = ('' + t.name).toLowerCase() }) }}fr = []for (f of franchisesTable.iterate(null, null)) {c = counts[f.id] != null ? counts[f.id] : 0fr.push({ id = f.id name = f.name href = '/franchises/' + f.slug summary = f.summary != null ? f.summary : ''countText = c == 1 ? '1 timeline' : c + ' timelines' sortName = ('' + f.name).toLowerCase() })}return { franchises = byNameOf(&fr) timelines = byNameOf(&loose) }}// { franchises (page 1 only), timelines (this page's), total, page, pages } — `raw` is the address's page segment (anything but a whole number ≥ 1 is// page 1, past the last is the last)static franchiseIndexPage = (&raw) => {all = franchiseIndex()pages = timelinePagesOf(&all.timelines.length)page = pageNumberOf(&raw, &pages)return { franchises = page == 1 ? all.franchises : [] timelines = all.timelines.slice((page - 1) * timelinePageSize, page * timelinePageSize) total = all.timelines.length page = page pages = pages }}// /franchises/<slug>: the franchise and its timelines (oldest first by their first release) — or nullstatic franchisePage = (slug) => {f = franchiseBySlug(&slug)if (f == null) { return null }let blocks = []for (t of timelinesTable.find(null, null)) {if (t.franchise == f.id && t.supersededBy == null) {b = blockOf(&t)next = []let done = falsefor (x of blocks) {if (!done && b.first != '' && (x.first == '' || b.first < x.first)) { next.push(b) done = true }next.push(x)}if (!done) { next.push(b) }blocks = next}}return { kind = 'franchise' name = f.name slug = f.slug summary = f.summary != null ? f.summary : '' franchiseName = '' franchiseHref = '' blocks = blocks editHref = '' }}// /timelines/<slug>: one timeline, its franchise above it — or nullstatic timelinePage = (slug) => {t = timelineBySlug(&slug)if (t == null) { return null }f = franchiseById(&t.franchise)return { kind = 'timeline' name = t.name slug = t.slug summary = '' franchiseName = f != null ? f.name : '' franchiseHref = f != null ? '/franchises/' + f.slug : ''blocks = [blockOf(&t)] editHref = '/timelines/' + t.slug + '/edit' }}// ---- the widget on a show / movie page: one per timeline the title is in ----------------------------------------------------// { id, name, href, hasFranchise, franchiseName, franchiseHref, hasPrev, noPrev, prevHref, prevTitle, hasNext, noNext, … }:// prequel / sequel = the nearest PUBLIC title before / after this one in the timeline's orderstatic widgetsOf = (&showId) => {out = []if (showId == null) { return out }for (tid of timelineIdsOfShow(&showId)) {t = timelinesTable.fetch(tid)if (t != null && t.supersededBy == null && t.order != null && t.order.includes(showId)) {at = posOf(&t.order, &showId)let prev = nulllet i = at - 1while (prev == null && i >= 0) {s = showById(&t.order[i])if (s != null && isPublicTitle(&s)) { prev = s }i = i - 1}let next = nulllet j = at + 1while (next == null && j < t.order.length) {s = showById(&t.order[j])if (s != null && isPublicTitle(&s)) { next = s }j = j + 1}f = franchiseById(&t.franchise)out.push({ id = t.id name = t.name href = '/timelines/' + t.slughasFranchise = f != null franchiseName = f != null ? f.name : '' franchiseHref = f != null ? '/franchises/' + f.slug : ''hasPrev = prev != null noPrev = prev == null prevHref = prev != null ? titlePath(&prev) : '' prevTitle = prev != null ? titleWithYear(&prev) : ''hasNext = next != null noNext = next == null nextHref = next != null ? titlePath(&next) : '' nextTitle = next != null ? titleWithYear(&next) : '' })}}return out}// ---- the editor (the creator only — every caller checks isEditorSession first) ----------------------------------------------static createFranchise = (name, summary) => {n = trimmedOr(&name)if (n == null || n.length > 120) { return { error = 'a franchise needs a name (at most 120 characters)' } }s = trimmedOr(&summary)rec = { id = newId() name = n slug = freeSlug(&franchisesTable, &n) shortId = null summary = s != null ? s : '' created = now() }if (franchisesTable.put(rec) == null) { return { error = 'not stored: ' + franchisesTable.lastError() } }franchisesTable.persist()console.log('franchises: new franchise "' + n + '" /franchises/' + rec.slug)return { ok = true slug = rec.slug id = rec.id }}// a new timeline (the editor's, the collection seed's with its collection id, the curated seed's with its order kind)static putTimeline = (name, &franchiseId, order, source, &collection, &orderKind) => {rec = { id = newId() name = name slug = freeSlug(&timelinesTable, &name) franchise = franchiseId order = order source = sourcetmdbCollection = collection orderKind = orderKind created = now() }if (timelinesTable.put(rec) == null) { return null }for (sid of order) { indexAdd(&sid, &rec.id) }return rec}static createTimeline = (&name) => {n = trimmedOr(&name)if (n == null || n.length > 120) { return { error = 'a timeline needs a name (at most 120 characters)' } }rec = putTimeline(n, null, [], 'editor', null, null)if (rec == null) { return { error = 'not stored: ' + timelinesTable.lastError() } }timelinesTable.persist()console.log('franchises: new timeline "' + n + '" /timelines/' + rec.slug)return { ok = true slug = rec.slug id = rec.id }}// the editor's view of one timeline: every title in its order (adult ones too — the creator sees what is there)static editRowsOf = (&t) => {out = []if (t == null || t.order == null) { return out }let i = 0last = t.order.length - 1for (sid of t.order) {s = showById(&sid)if (s != null) {out.push({ id = s.id pos = i + 1 title = titleWithYear(&s) posterUrl = posterUrlOf(&s) typeLabel = s.type == 'series' ? 'Series' : 'Movie' typeClass = s.type == 'series' ? 'pill type-2' : 'pill type-1'upClass = i == 0 ? 'quiet mv off' : 'quiet mv' downClass = i == last ? 'quiet mv off' : 'quiet mv' })}i = i + 1}return out}static chipsOf = (&t) => {out = [{ id = '' name = 'None' cls = t == null || t.franchise == null || t.franchise == '' ? 'chip on' : 'chip' }]list = []for (f of franchisesTable.find(null, null)) { list.push({ id = f.id name = f.name cls = t != null && t.franchise == f.id ? 'chip on' : 'chip' sortName = ('' + f.name).toLowerCase() }) }for (c of byNameOf(&list)) { out.push(c) }return out}static editPageOf = (slug) => {t = timelineBySlug(&slug)if (t == null) { return { found = false id = '' name = '' slug = '' viewHref = '' rows = [] chips = [] } }return { found = true id = t.id name = t.name slug = t.slug viewHref = '/timelines/' + t.slug rows = editRowsOf(&t) chips = chipsOf(&t) }}static storeOrder = (t, order) => {old = t.order != null ? t.order : []rec = trec.order = orderif (timelinesTable.update(rec.id, rec) == null) { return { error = 'not stored: ' + timelinesTable.lastError() } }timelinesTable.persist()for (sid of old) { if (!order.includes(sid)) { indexRemove(&sid, &rec.id) } }for (sid of order) { indexAdd(&sid, &rec.id) }return { ok = true rows = editRowsOf(&rec) }}// tracker#31 (merge.hl): a duplicate title merged into its keeper — in every timeline that lists it, the keeper takes its place// (once: a timeline that already lists the keeper just drops it) → the number of timelines changedstatic titleMerged = (&fromId, &toId) => {ensureFranchises()let n = 0tids = []if (byShow[fromId] != null) { for (x of byShow[fromId]) { tids.push(x) } }for (tid of tids) {t = timelinesTable.fetch(tid)if (t != null && t.order != null) {order = []for (sid of t.order) {want = sid == fromId ? toId : sidif (!order.includes(want)) { order.push(want) }}r = storeOrder(t, order)if (r.error != null) { console.log('merge: timeline ' + tid + ': ' + r.error) } else { n = n + 1 }}}return n}static addToTimeline = (&timelineId, &showId) => {t = timelineById(&timelineId)if (t == null) { return { error = 'no such timeline' } }if (showById(&showId) == null) { return { error = 'no such title' } }order = []for (sid of t.order) { order.push(sid) }if (order.includes(showId)) { return { ok = true rows = editRowsOf(&t) } }order.push(showId)return storeOrder(t, order)}static removeFromTimeline = (&timelineId, &showId) => {t = timelineById(&timelineId)if (t == null) { return { error = 'no such timeline' } }order = []for (sid of t.order) { if (sid != showId) { order.push(sid) } }return storeOrder(t, order)}// one place up (delta -1) or down (+1); at an end nothing changesstatic moveInTimeline = (&timelineId, &showId, &delta) => {t = timelineById(&timelineId)if (t == null) { return { error = 'no such timeline' } }at = posOf(&t.order, &showId)to = at + (delta < 0 ? -1 : 1)if (at < 0 || to < 0 || to >= t.order.length) { return { ok = true rows = editRowsOf(&t) } }order = []let i = 0while (i < t.order.length) {if (i == at) { order.push(t.order[to]) } else if (i == to) { order.push(t.order[at]) } else { order.push(t.order[i]) }i = i + 1}return storeOrder(t, order)}static setTimelineFranchise = (&timelineId, franchiseId) => {t = timelineById(&timelineId)if (t == null) { return { error = 'no such timeline' } }let fid = nullif (franchiseId != null && franchiseId != '') {if (franchiseById(&franchiseId) == null) { return { error = 'no such franchise' } }fid = franchiseId}rec = trec.franchise = fidif (timelinesTable.update(rec.id, rec) == null) { return { error = 'not stored: ' + timelinesTable.lastError() } }timelinesTable.persist()return { ok = true chips = chipsOf(&rec) }}// the editor's title search: our database (search.hl's index), the titles not in the timeline yetstatic editSearch = (&timelineId, text) => {t = timelineById(&timelineId)have = t != null && t.order != null ? t.order : []out = []r = dbSearch(textArg(&text))for (x of r.titles) {s = showById(&x.id)if (s != null && !have.includes(s.id)) { out.push({ id = s.id title = titleWithYear(&s) posterUrl = posterUrlOf(&s) typeLabel = s.type == 'series' ? 'Series' : 'Movie' typeClass = s.type == 'series' ? 'pill type-2' : 'pill type-1' }) }}return { text = text rows = out note = r.tooShort ? 'Type at least 2 letters.' : (out.length == 0 ? 'Nothing found.' : '') }}// the editor's timeline finder: by name, at most 30static findTimelines = (&text) => {q = textArg(&text).trim().toLowerCase()out = []if (q.length < 2) { return out }for (t of timelinesTable.find(null, null)) {if (out.length < 30 && ('' + t.name).toLowerCase().includes(q)) {n = t.order != null ? t.order.length : 0hidden = t.supersededBy != null ? ' · hidden: all in ' + nameOfTimeline(&t.supersededBy) : ''out.push({ id = t.id name = t.name href = '/timelines/' + t.slug + '/edit' countText = (n == 1 ? '1 title' : n + ' titles') + hidden })}}return out}// ---- the curated seed's reads and writes (franchiseseed.hl, tracker#40) ----------------------------------------------------// a franchise / timeline by its name, any case — or null (the creator's own of that name is adopted by the seed, never doubled)static franchiseByName = (&name) => {q = ('' + name).toLowerCase()let hit = nullfor (f of franchisesTable.find(null, null)) { if (hit == null && ('' + f.name).toLowerCase() == q) { hit = f } }return hit}static timelineByName = (&name) => {q = ('' + name).toLowerCase()let hit = nullfor (t of timelinesTable.find(null, null)) { if (hit == null && ('' + t.name).toLowerCase() == q) { hit = t } }return hit}// the timeline the collection seed made from TMDB collection `collection`, or nullstatic timelineOfCollection = (&collection) => {let hit = nullfor (t of timelinesTable.find(null, null)) { if (hit == null && t.tmdbCollection != null && '' + t.tmdbCollection == '' + collection) { hit = t } }return hit}// a seeded timeline rewritten (the data file changed, or titles were imported since): its order and franchise in one updatestatic storeSeeded = (t, order, &franchiseId) => {old = t.order != null ? t.order : []rec = trec.order = orderrec.franchise = franchiseIdif (timelinesTable.update(rec.id, rec) == null) { return { error = 'not stored: ' + timelinesTable.lastError() } }for (sid of old) { if (!order.includes(sid)) { indexRemove(&sid, &rec.id) } }for (sid of order) { indexAdd(&sid, &rec.id) }return { ok = true }}static persistFranchises = () => {franchisesTable.persist()timelinesTable.persist()return true}// ---- superseded collection timelines (tracker#40) --------------------------------------------------------------------------------static nameOfTimeline = (&id) => {t = timelineById(&id)return t != null ? t.name : '?'}// for a collection's titles: `cover` = the curated (seed) timeline holding ALL of them, or null; `franchise` = the cover's// franchise, else the franchise of a curated timeline holding at least ONE of them (a partly covered collection joins it), or nullstatic seededTimelines = () => {out = []for (t of timelinesTable.find(null, null)) { if (t.source == 'seed' && t.order != null) { out.push(t) } }return out}// mission 046: the cover against a PRE-LOADED list of the curated timelines (seededTimelines): the seed's supersedeCollections asks it for// every one of the 1,417 live timelines — each ask re-read the whole timelines table (find → 1,417 decodes): 2 M decodes, ONE 10–22 s// tick at the end of boot (the 22 s TTFB of 045's run A). Same answer, the first match in table order as before.static seededCoverIn = (&seeds, &order) => {let whole = nulllet part = nullfor (t of seeds) {let all = order.length > 0let any = falsefor (sid of order) { if (t.order.includes(sid)) { any = true } else { all = false } }if (all && whole == null) { whole = t }if (any && part == null && t.franchise != null && t.franchise != '') { part = t.franchise }}// (locals not named like the answer's entries: inside a record literal an entry shadows that name for the entries after it)return { cover = whole != null ? whole.id : null franchise = whole != null && whole.franchise != null ? whole.franchise : part }}static seededCoverOf = (&order) => {return seededCoverIn(seededTimelines(), &order)}// hidden behind `byId` (null: shown again)static setSuperseded = (t, &byId) => {rec = trec.supersededBy = byIdif (timelinesTable.update(rec.id, rec) == null) { return { error = 'not stored: ' + timelinesTable.lastError() } }return { ok = true }}// tracker#59: franchise page rows.static pageOf = (slug, &tslug) => {p = tslug != null ? timelinePage(tslug) : franchisePage(slug)return p != null ? p : { kind = 'none' name = '' slug = '' summary = '' franchiseName = '' franchiseHref = '' blocks = [] editHref = '' }}static editorOf = (&session) => { return isEditorSession(&session) }static flatRows = (&blocks, &modes, &named) => {out = []for (b of blocks) {byRelease = modes[b.id] == 'release'out.push({ kind = 'head' isHead = true isItem = false key = b.id id = b.id name = b.name hasName = named href = b.href countText = b.countTexttimelineClass = byRelease ? 'sortbtn' : 'sortbtn on' releaseClass = byRelease ? 'sortbtn on' : 'sortbtn' })list = byRelease ? b.byRelease : b.itemsfor (it of list) {out.push({ kind = 'item' isHead = false isItem = true key = b.id + ':' + it.id id = it.id timeline = b.id pos = it.pos title = it.title href = it.hrefposterUrl = it.posterUrl typeLabel = it.kind typeClass = pillClassOfWord(&it.kind) dateLabel = it.dateLabel })}}return out}
Branches
Latest commits
- 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
- 7c051eddLog: hybriel#338 answermre
- d049b8b8Log: HM50 live, #52 donemre
- 6d05fa37Log: HM50 Part A mergedmre
- 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
- e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
- 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
- 2f391aa9Log: HM50 startedmre
- 4b59c03dHM50 mission: doc pathmre
- ed526d67HM50 missionmre
- 2f986ca3Log: RT50 passmre
- 1c4715a4RT50 mission: day50 repro retestmre
- 57d1c0dcLog: day50 retest requestmre
- 60b1f419Log: Anton #336 result, wake checkmre
- 919a18aalog: scratchmre
- 6b504440status tidymre
- 9332bd10log: DP70 livemre
- be11daa0DP70 brief fixmre
- 886a7028DP70 brief, HM67 mergedmre
- b41cdd6dMerge hm67-searchids: packed search IDsmre