Skip to content

Remove a deleted series from the trakt.tv collection - #338

Open
zotabee wants to merge 2 commits into
jellyfin:masterfrom
zotabee:remove-deleted-series
Open

zotabee wants to merge 2 commits into
jellyfin:masterfrom
zotabee:remove-deleted-series

Conversation

@zotabee

@zotabee zotabee commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

With "Don't remove from Trakt when deleted from Jellyfin" unticked, deleting a whole series left all its episodes in the trakt.tv collection. CanSync drops the series' own removal, and by the time Jellyfin reports the episodes as removed they're no longer linked to their series (LibraryManager.cs), so they're dropped too.

A series removal now sends one show-level remove to /sync/collection/remove. Right before, it checks whether a series with the same ids is still in the library (another copy, or the show was moved) and keeps it collected if so. Show removals now run before episode adds, one batch at a time, so a show that was moved isn't removed after its episodes were added back. If the request for one show fails, the other shows are still sent; if trakt.tv can't be reached, times out or rejects the account (401, 403, 420, 423, 429, or 502 and above), the remaining shows aren't sent, since they would fail the same way.

Tested in a harness (a deleted series is removed, a deleted season works as before, moved, renamed or duplicated HD + 4K series stay collected), and live on my Jellyfin 12.1 server: a test show with 4 episodes reached trakt.tv, and after its folder was deleted and the library scanned, the plugin logged Processing 1 shows with event type Remove, sent one show-level remove, and the show left the collection. In the harness, when the first of three removals fails, a 500 still sends the other two, and a 401 or a locked account stops after the first.

The requests in that harness case (three series deleted, trakt.tv answers 500 to the first), before and after the last commit:

  POST /sync/collection/remove  Show Broken  -> 500
+ POST /sync/collection/remove  Show B       -> 200
+ POST /sync/collection/remove  Show C       -> 200

Merges cleanly with #329 and #341, which change the same file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019NK5BSFsEuuqMcNPPpysee
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selmant added a commit to selmant/better-trakt that referenced this pull request Oct 23, 2026
…t.tv collection

jellyfin#338
Original author: @zotabee. Thanks for the contribution!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant