spotters: most-active-in sort with country/region selector, collection tracking (seen marks, progress, filters), refresh scripts score activity and report new NL entries
Some checks failed
Deploy production / deploy (push) Has been cancelled

This commit is contained in:
2026-10-25 13:24:37 +00:00
parent 3f294df337
commit 253cd69424
58 changed files with 2151 additions and 72 deletions

View File

@@ -9,7 +9,11 @@
# are stable (types are matched by Wikidata id).
# 2. bun scripts/trains-photos.ts --missing finds Wikimedia Commons photos for types that
# have none yet (new ones included) and maker and operator logos that are missing.
# stdout: one JSON report {generatedAt, totals, newMakers, newTypes[] (with photo)}.
# 3. bun scripts/spotters-activity.ts trains refreshes the per-country activity scores
# ("most active in NL" sort; see that script).
# stdout: one JSON report {generatedAt, totals, newMakers, newTypes[] (with photo)}, plus `nl` per new
# entry and `newInNl` (new entries that are active in the Netherlands, see
# scripts/spotters-report-nl.ts). --report-new is accepted (the report is always printed).
# Progress goes to stderr. DB_URL is read from the running app container and never printed.
set -euo pipefail
cd "$(dirname "$0")/.."
@@ -20,8 +24,12 @@ if [ -z "${DB_URL:-}" ]; then
export DB_URL
fi
args=()
for a in "$@"; do [ "$a" = "--report-new" ] || args+=("$a"); done
report=$(mktemp /tmp/trains-report.XXXXXX.json)
trap 'rm -f "$report"' EXIT
bun scripts/trains-import.ts --report-new "$@" >"$report"
bun scripts/trains-photos.ts --missing --enrich "$report" --fetch
bun scripts/trains-import.ts --report-new "${args[@]}" >"$report"
bun scripts/spotters-activity.ts trains >&2
bun scripts/trains-photos.ts --missing --enrich "$report" --fetch | bun scripts/spotters-report-nl.ts trains