Big content update

This commit is contained in:
Greg Kilmer
2026-07-11 20:31:13 -04:00
parent 67f3fd311f
commit e0f41c98a7
76 changed files with 3659 additions and 165 deletions
+92
View File
@@ -234,6 +234,98 @@ It's idempotent — run it again any time you add games to the JSON.
---
## Media viewing history (Anime, TV, Movies, Reading pages)
Four interest pages — **Anime** (`/interests/anime`), **TV Shows**
(`/interests/tv`), **Movies** (`/interests/movies`), and **Reading**
(`/interests/reading`) — share one data pattern. Each reads a JSON file, shows
the **favorites** as poster/cover cards up top, then the **full library**
grouped by category as pills below.
The data files and their pages:
| Page | Data file |
|---|---|
| Anime | `src/data/media/anime.json` |
| TV Shows | `src/data/media/tv.json` |
| Movies | `src/data/media/movies.json` |
| Reading | `src/data/reading.json` |
### The shared item shape
A flat JSON array. Each entry has a `title` plus optional fields. The
`favorite` flag is the **single source of truth** for what appears in the top
grid — set it on the entry itself, no separate favorites list to keep in sync.
`category` drives the grouping of the full library below (items without a
category appear only in favorites, if favorited).
```json
[
{
"title": "Breaking Bad",
"favorite": true,
"blurb": "The character study of a decade."
},
{
"title": "Dark",
"category": "Streaming Originals",
"status": "Completed",
"note": "Optional short detail shown on hover."
}
]
```
| Field | Type | Notes |
|---|---|---|
| `title` | string | Display label (required) |
| `favorite` | boolean | True → rich card in the top "Favorites" grid |
| `category` | string | Grouping label for the full library, e.g. "Prestige Drama" |
| `status` | string | Pill text, e.g. "Completed", "Watching", "Caught up" |
| `year` | number | Release year; shown on movie/anime pills |
| `count` | string | Human span for a franchise, e.g. "All 4 films" |
| `blurb` | string | Long-form copy on favorite cards |
| `note` | string | Short detail on a full-list pill (hover/title attr) |
| `image` | string | Local art path; populated by the fetch tools below |
Adding an entry is just dropping another object in the right JSON file. The
page reads it via the helpers in `src/lib/media.ts` (`getFavorites`,
`getGrouped`). Categories appear in order of first occurrence, so order the
file the way you want the page grouped.
**Movies are film-level:** each entry is one film, with `category` naming the
franchise it belongs to (e.g. "The Matrix", "Marvel Cinematic Universe").
Single films with no sequel go under `category: "Standalone"`. A favorite film
carries `favorite: true` so it appears in the top grid **and** in its franchise
group.
### Fetching poster/cover art
Three idempotent scripts fill in the `image` field for **favorites only** (the
full library stays text pills), downloading to `public/images/<kind>/`:
```bash
# Anime — AniList GraphQL API (free, NO key required)
node scripts/fetch-anime-art.mjs
node scripts/fetch-anime-art.mjs --force # re-fetch existing
# Reading — Open Library Covers API (free, NO key required)
node scripts/fetch-book-covers.mjs
# Movies + TV — TMDB API (free key required: TMDB_API_KEY in .env)
node --env-file=.env scripts/fetch-tmdb-art.mjs
node --env-file=.env scripts/fetch-tmdb-art.mjs --kind movies
node --env-file=.env scripts/fetch-tmdb-art.mjs --kind tv
```
All three skip items that already have an `image` (use `--force` to re-fetch),
sleep briefly between requests, and write the local path back into the JSON.
Get a free TMDB key at <https://www.themoviedb.org/settings/api>.
Cards render the `image` when present and fall back to a kind-derived icon slab
otherwise, so partial coverage looks intentional.
---
## TCGs (Trading Card Games page)
The TCGs page (`src/pages/interests/tcgs.astro`) is hand-built, like the other