No description
  • TypeScript 100%
Find a file
keeb 3bb5cc67ec Pin provider IDs in identify; add reindex_recent and scan_status
identify's mappings values now accept an object pinning explicit provider
IDs instead of only a search string:

  {"bleach-tybw": {"imdb": "tt14986406", "name": "Bleach: TYBW"}}

Keys imdb/tmdb/tvdb/anidb/anilist/mal normalize to Jellyfin's ProviderIds
casing; optional name/year seed the search, with name falling back to the
item's own. Pinned IDs are passed through SearchInfo.ProviderIds so
providers resolve the exact entry.

Critically, a pinned lookup applies only a result carrying every pinned ID
and refuses otherwise, rather than falling back to searchResults[0]. That
fallback is how a parent series gets stamped onto a cour sharing no ID with
it — TMDB folds Bleach: Thousand-Year Blood War into the 2004 Bleach entry,
so a title search returns Bleach 30984 first and applying it would collide
with the existing /anime/completed/bleach. String mappings are unchanged.

Also lands work that was sitting uncommitted in the tree:

- reindex_recent: reads recently-organized items from organizeSource, maps
  mediaType to libraries via libraryMap, and Default-mode reindexes only the
  touched libraries, advancing a watermark each run.
- scan_status: bounded-settle wait after a reindex. Jellyfin exposes no
  completion signal for item-tree metadata refreshes, so the settle window
  is the effective wait for that path.
- reindexWatermark resource plus libraryMap/organizeSource global args.
- Reports drop the asModelType shim — current swamp's
  dataRepository.getContent takes the modelType string directly.

Version 2026.04.26.1 -> 2026.08.12.1 with a matching upgrade-chain entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 18:15:46 -07:00
.claude/skills/jellyfin feat: add embedded jellyfin skill for AI agents 2026-04-06 18:33:51 -07:00
extensions Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
tests/property Add property-based schema tests (fast-check via @traversable/zod-test) 2026-07-18 09:19:17 -07:00
.gitignore Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
.swamp.yaml Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
CLAUDE.md Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
LICENSE.txt Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
manifest.yaml Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00
README.md Pin provider IDs in identify; add reindex_recent and scan_status 2026-08-11 18:15:46 -07:00

@keeb/jellyfin

A swamp extension that integrates a Jellyfin media server into swamp workflows. It exposes the @keeb/jellyfin model type for library inventory, full library refresh, duplicate/misplacement auditing, unidentified media detection, and applying matches through the Jellyfin RemoteSearch API. Two bundled reports (@keeb/library-audit and @keeb/unidentified-media) turn model output into human-readable markdown summaries.

Installation

swamp extension install @keeb/jellyfin

Usage

Add a model definition that points at your Jellyfin server and an API key, then run the inventory, audit, or unidentified methods:

models:
  - name: media
    type: "@keeb/jellyfin"
    globalArguments:
      jellyfinUrl: "http://jellyfin.lan:8096"
      jellyfinApiKey: "${{ vault.jellyfin.apiKey }}"
swamp model method run media inventory
swamp model method run media audit
swamp model method run media unidentified --args '{"types":"Series,Movie"}'

The identify method applies metadata matches by name or path substring:

swamp model method run media identify \
  --args '{"mappings":"{\"dragonball-z-remastered\":\"Dragon Ball Z\"}","dryRun":true}'

How it works

The model wraps a handful of Jellyfin HTTP endpoints (/Library/VirtualFolders, /Users/{id}/Items, /Items/RemoteSearch/{type}) behind named methods. Each method writes a structured resource (inventory, audit, unidentified, identification, scan) into the swamp data repository, which downstream reports and CEL expressions can reference with data.latest(...). The audit method classifies duplicate detections as either true_duplicate or shared_tmdb_id by comparing production years, titles, and directory stems, so distinct productions that share a TMDB ID are not flagged as issues.