Skip to content

Send new library items to trakt.tv once, with their refreshed metadata - #341

Open
zotabee wants to merge 1 commit into
jellyfin:masterfrom
zotabee:refresh-queued-library-items
Open

zotabee wants to merge 1 commit into
jellyfin:masterfrom
zotabee:refresh-queued-library-items

Conversation

@zotabee

@zotabee zotabee commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

When a library is scanned, each new movie is posted to /sync/collection twice: first with the folder name as title, no imdb id and no resolution or HDR, then 0.3 s later with the right values. The plugin queues the item from ItemAdded, but Jellyfin refreshes the metadata on another copy loaded from the database (Folder.cs).

When the queue is processed, each movie or episode is now read again from the library (ILibraryManager.RetrieveItem), and an Add and an Update of the same item are sent once. Removals and series are unchanged. If Jellyfin's metadata refresh of a new item takes more than 10 s, it can still be sent twice, as before: Jellyfin saves a new item once before fetching its metadata and once after.

Tested on my Jellyfin 12.1 server, adding Apollo 13 (1995) to a library before and after the change:

Posts Title Imdb Resolution HDR
Before (first post) 2 Apollo 13 (1995) [tmdbid-568] null null null
With the change 1 Apollo 13 tt0112384 uhd_4k hdr10_plus

Also tested in a harness (an item deleted in the same batch, two users, a failing read). Merges cleanly with #329 and #338, which change the same file.

selmant added a commit to selmant/better-trakt that referenced this pull request Oct 23, 2026
…ce, with their refreshed metadata

jellyfin#341
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