Fetch TV through its library, not the physical folder (1.4.1) #10

Merged
joeyr merged 1 commit from fix/tv-by-library into main 2026-10-05 20:52:23 -05:00
Owner

New episodes of some shows could be left out of the email. Jellyfin's recursive query by the physical TV folder omits items whose ancestor index is stale; the same query by library returns them. Measured: 13 of 52 series and 956 episodes missing from one folder, plus 90 "series doesn't exist" warnings per run.

  • jellyfin/series_by_library.go (new): getSeriesFolderItems finds the library that lists the watched folder and keeps the series whose Path is under it, plus their seasons and episodes by SeriesId (some seasons have no path, and a library can span several folders). It falls back to the folder query if no library lists the folder, or if listing fails (it can need an admin key). GetLibraryFolders wraps /Library/VirtualFolders.
  • client.go, libraryItemsApi.go: the new interface method, the library-structure API on the client, and Path in the TV query's fields. series.go calls the new lookup.
  • Tests: filtering by location across a two-folder library, the library path being used (the folder query must not be), and both fallbacks.
  • Dry run against the real server with the newsletter's own key: no fallback, warnings down from 90 to 2 (both "Folder not found" for configured folders that don't exist), the same 17 shows.
  • VERSION 1.4.1, CHANGELOG, CLAUDE.md.

🤖 Generated with Claude Code

New episodes of some shows could be left out of the email. Jellyfin's recursive query by the physical TV folder omits items whose ancestor index is stale; the same query by library returns them. Measured: 13 of 52 series and 956 episodes missing from one folder, plus 90 "series doesn't exist" warnings per run. - `jellyfin/series_by_library.go` (new): `getSeriesFolderItems` finds the library that lists the watched folder and keeps the series whose `Path` is under it, plus their seasons and episodes by `SeriesId` (some seasons have no path, and a library can span several folders). It falls back to the folder query if no library lists the folder, or if listing fails (it can need an admin key). `GetLibraryFolders` wraps `/Library/VirtualFolders`. - `client.go`, `libraryItemsApi.go`: the new interface method, the library-structure API on the client, and `Path` in the TV query's fields. `series.go` calls the new lookup. - Tests: filtering by location across a two-folder library, the library path being used (the folder query must not be), and both fallbacks. - Dry run against the real server with the newsletter's own key: no fallback, warnings down from 90 to 2 (both "Folder not found" for configured folders that don't exist), the same 17 shows. - VERSION 1.4.1, CHANGELOG, CLAUDE.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fetch TV through its library, not the physical folder (1.4.1)
All checks were successful
CI / gate (pull_request) Successful in 1m3s
CI / lint (pull_request) Successful in 56s
CI / image (pull_request) Has been skipped
ca838f475e
GetAllItemsByFolderID queried the watched TV folder recursively by its
physical-folder ID, and Jellyfin's answer omits items whose ancestor
index is stale; the same query by library ID returns them. Measured on
2026-10-05: 13 of 52 series and 956 episodes missing from one folder,
and 90 "series doesn't exist" warnings per run.

getSeriesFolderItems (series_by_library.go) finds the library whose
locations include the watched folder (/Library/VirtualFolders through
the new LibraryAPIInterface.GetLibraryFolders), queries it, and keeps
the series whose Path is under that folder plus their seasons and
episodes by SeriesId, since some seasons have no path and a library can
span several folders. If no library lists the folder, or listing fails
(it can need an admin key), it falls back to the folder query with a
warning rather than failing the run. Path is added to the query's
fields.

A dry run against the real server with the newsletter's own key: no
fallback, 90 warnings down to 2 (both "Folder not found" for configured
folders that don't exist), and the same 17 shows, since none of the
missed series had anything new.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
joeyr merged commit 407083fc51 into main 2026-10-05 20:52:23 -05:00
joeyr deleted branch fix/tv-by-library 2026-10-05 20:52:23 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joeyr/jellyfin-newsletter!10
No description provided.