Your media library with Jennifer

Jennifer

Music tags, film data, a Jellyfin™ server and the Steam™ pile of shame, with four community decks and a picker for tonight at the end.

November 2026, by @mplx.
Based on Jennifer 0.26.0

Powered by Jennifer's Cantrip - Markdown into slide decks, https://github.com/jennifer-language/cantrip
1 / 21

Four decks, one library

DeckTalks toNeeds
@deckyard/mp3MP3 files on disknothing
@deckyard/jellyfinyour Jellyfin serveruser and password, or an API key
@skiffyard/tmdbThe Movie Databasea read access token
@skiffyard/steamthe Steam Web API and storea Web API key
jvc add @deckyard/mp3        # and the other three
jvc install                  # copies them into vendor/
2 / 21

A folder of messy MP3s

for (def name in fs.list($dir)) {
    if (not strings.endsWith($name, ".mp3")) { continue; }
    def t as mp3.Track init mp3.open(path.join($dir, $name));
    io.printf("%s\n  %s\n", $name, mp3.describe($t));
}
02 square dance.mp3
  The Jennifers - SQUARE DANCE  0:05  128 kbit/s  44100 Hz  stereo
03 - low hum.mp3
  0:09  96 kbit/s  44100 Hz  mono
track01.mp3
  the jennifers -   sine at dawn   0:07  128 kbit/s  44100 Hz  stereo
3 / 21

What a Track holds

FieldWhat it is
t.tagone mp3.Tag for ID3v2.2, 2.3, 2.4 and ID3v1 alike
t.tag.title, .artist, .yeartext, "" when missing
t.tag.track, .trackTotalint, 0 when missing
t.tag.picturesa list of mp3.Picture: the cover art
t.audiothe MPEG stream: durationMs, bitrate
t.id3v2, t.id3v1the raw tags, with present and every frame

The file said genre (52); t.tag.genre reads Electronic.

4 / 21

Fixing one file

def t as mp3.Track init mp3.open("music/track01.mp3");
def tag as mp3.Tag init $t.tag;          # a copy
$tag.title = "Sine At Dawn";
$tag.artist = "The Jennifers";
mp3.save(mp3.withTag($t, $tag), "music/01 - Sine At Dawn.mp3");
5 / 21

Cover art is just bytes

if (len($tag.pictures) == 0 and len($cover) > 0) {
    $tag.pictures[] = mp3.Picture{mimeType: "image/png",
        kind: mp3.PICTURE_FRONT_COVER, description: "", data: $cover};
}
def art as mp3.Picture init mp3.coverArt($t.tag);
if (len($art.data) > 0) { fs.writeBytes("cover.png", $art.data); }

mp3.pictureTypeName(3) is "Cover (front)".

6 / 21

The batch tool: tidy.j

for (def name in fs.list($dir)) {
    if (not strings.endsWith($name, ".mp3")) { continue; }
    def t as mp3.Track init mp3.open(path.join($dir, $name));
    def tag as mp3.Tag init tidy($t, $name, $cover);
    def target as string init io.sprintf("%d|pad=2|fill=0 - %s.mp3",
        $tag.track, $tag.title);
    if ($tag == $t.tag and $target == $name) { continue; }
    io.printf(...);   # old name -> new name, genre, cover
    if (os.hasFlag("--write")) {
        mp3.save(mp3.withTag($t, $tag), path.join($dir, $target));
        ...               # remove the old file when renamed
    }
}
7 / 21

Dry run, then --write

jennifer run tidy.j --dir music --artist "The Jennifers" \
    --album "Test Tones"
02 square dance.mp3
  -> 02 - Square Dance.mp3  [Electronic, Cover (front)]
03 - low hum.mp3
  -> 03 - Low Hum.mp3  [Electronic, Cover (front)]
track01.mp3
  -> 01 - Sine At Dawn.mp3  [Electronic, Cover (front)]
4 file(s) to fix: dry run, add --write

After --write, a second run says 0 file(s) to fix.

8 / 21

A report and a playlist

def e as mp3.PlaylistEntry init mp3.entryFromTrack($t);
$e.path = $name;   # relative: the playlist sits beside the music
$entries[] = $e;
...
mp3.savePlaylist($pl, path.join($dir, "test-tones.m3u8"));
4 tracks, 0:27, 0 without cover
#EXTM3U
#PLAYLIST:Test Tones
#EXTINF:7,The Jennifers - Sine At Dawn
01 - Sine At Dawn.mp3
9 / 21

Jellyfin: a server of your own

docker run -d --name academy-media-jellyfin \
  -p 127.0.0.1:18096:8096 \
  -v "$PWD/jellyfin/movies:/media/movies:ro" \
  -v "$PWD/jellyfin/music:/media/music:ro" jellyfin/jellyfin
def c as jellyfin.Client init jellyfin.client("http://127.0.0.1:18096");
def s as jellyfin.ServerInfo init jellyfin.serverInfo($c);
io.printf("%s %s\n", $s.productName, $s.version);
Jellyfin Server 12.4.0
10 / 21

Signing in

$c = jellyfin.withDevice($c, "Media Talk", "laptop", "media-talk-laptop");
$c = jellyfin.login($c, "jen", os.getEnv("JELLYFIN_PASSWORD"));
def me as jellyfin.User init jellyfin.me($c);
for (def l in jellyfin.libraries($c)) {
    io.printf("library %s (%s)\n", $l.name, $l.collectionType);
}
signed in as jen, administrator: true
library Movies (movies)
library Music (music)
11 / 21

An API key, a library scan

jellyfin.call($c, "POST", "/Auth/Keys", ["app=tonight"], $none);
...
def k as jellyfin.Client init jellyfin.withToken(
    jellyfin.client("http://127.0.0.1:18096"), os.getEnv("JELLYFIN_KEY"));
jellyfin.refreshLibrary($k);
new key for tonight: 6fe6... (32 characters)
Scan Media Library: Running
Scan Media Library: Completed
12 / 21

Search, and what nobody has watched

for (def hit in jellyfin.search($c, "sine", 10)) {
    io.printf("found %s: %s\n", $hit.type, $hit.name);
}
def p as jellyfin.Page init jellyfin.items($c, ["includeItemTypes=Movie",
    "recursive=true", "isPlayed=false", "sortBy=SortName"]);
found Audio: Sine At Dawn
found Movie: Sine Wave Serenade
4 unwatched movies
  Colour Bars at Dawn (2023), 4 s
  Mandelbrot Heist (2022), 4 s
13 / 21

TMDB: what is this film?

def c as tmdb.Client init tmdb.clientFromEnv();  # TMDB_ACCESS_TOKEN
def hits as tmdb.MoviePage init tmdb.searchMovies($c, "sine wave", 1);
for (def m in $hits.results) {
    io.printf("%d  %s (%s)  %f|prec=1\n", $m.id, $m.title,
        tmdb.year($m.releaseDate), $m.voteAverage);
}
def film as tmdb.Movie init tmdb.movie($c, $hits.results[0].id);
900003  Sine Wave Serenade (2025)  7.8
88 min, Romance, "Love at 440 Hz."
14 / 21

When TMDB says no

tmdb.TmdbError{kind: "tmdb", message: "GET https://api.themoviedb.org/
3/search/movie failed: HTTP 401: Invalid API key: You must be granted
a valid key.", status: 401, statusCode: 7}
KindMeansFields
tmdbTMDB refused, or bad inputstatus, statusCode
netno connection at allop, reason
limitthe reply was too big
15 / 21

Steam: the pile of shame

def me as string init steam.resolveAccount($c, "jen");
def games as list of steam.OwnedGame init steam.ownedGames($c, $me,
    true, false);
for (def g in steam.unplayed($games)) {
    io.printf("  never started: %s\n", $g.name);
}
STEAM_1:0:21 owns 6 games, 123.0 hours in total
  played: Llama Kart Deluxe            87.2 h
  never started: Spreadsheet Simulator 2026
  never started: The Long Compile
16 / 21

The project: what to watch tonight

  1. Jellyfin: every film nobody has watched (allItems)
  2. TMDB: its real runtime, rating and tagline
  3. Keep the films that fit the evening, pick the best rated
  4. No film fits? Steam: a game from the pile of shame
jennifer run tonight.j --minutes 100 [--mark]
17 / 21

Jellyfin item in, choice out

func lookUp(t as tmdb.Client, item as jellyfin.Item) {
    def c as Choice init Choice{item: $item, minutes: 0, rating: 0.0,
        line: ""};
    try {
        def hits as tmdb.MoviePage init tmdb.searchMoviesInYear($t,
            $item.name, $item.year, 1);
        if (len($hits.results) > 0) { ... }
    } catch (e) {
        io.eprintf("tmdb: %s (%s)\n", $e.message, $e.kind);
    }
    return $c;
}
18 / 21

Tonight's answer

- Colour Bars at Dawn    121 min  6.4
- Mandelbrot Heist       107 min  6.9
+ Sine Wave Serenade      88 min  7.8
+ The Test Pattern        94 min  7.1
tonight: Sine Wave Serenade (2025), 88 min. Love at 440 Hz.
marked as watched in Jellyfin

With --minutes 80:

no film fits; start Spreadsheet Simulator 2026 instead
19 / 21

Testing without the internet

TMDB_ACCESS_TOKEN=placeholder-tmdb-token \
STEAM_API_KEY=PLACEHOLDER-STEAM-KEY \
  ./run-offline.sh jennifer run tonight.j --minutes 100
20 / 21

Take-aways and read more

21 / 21