Repository navigation
Queue person metadata refresh instead of blocking the item request and fix ItemCounts - #17460
Conversation
Jellyfin API (v 12.0.0)ResultNo differences. Specifications are equivalent |
|
| } | ||
|
|
||
| await RefreshItemOnDemandIfNeeded(item).ConfigureAwait(false); | ||
| QueueRefreshOnDemandIfNeeded(item); |
There was a problem hiding this comment.
Doesn't this change mean that the DTO returned from GettBaseItemDto is essentially guaranteed to be the unchanged-yet existing data? Seem that make the return value of the GetItem pretty useless. We should likely set the right expectation by not returning a DTO from this method, since it's a "before" state.
There was a problem hiding this comment.
It's different behavior to any other endpoint we have and it is essentially a library refresh every time somebody calls the endpoint.
IMO implicitly refreshing data and not returning what is currently in the DB is bad practice
| public ActionResult<BaseItemDto> GetItemLegacy( | ||
| [FromRoute, Required] Guid userId, | ||
| [FromRoute, Required] Guid itemId) | ||
| => GetItem(userId, itemId); |
There was a problem hiding this comment.
The legacy version likely should really be doing a "wait" until the queue refresh finishes, so it isn't returning the "before" DTO...
|
Tested a bit
It is a big improvement, and I guess a similar time could only be achieved if a parameter is added to do less work for places that do not require the information. |
Changes
ItemCountsquery off an item-id sub-select instead of joining the mapping table into the count.PeopleBaseItemMaprows for it, and the old join counted that film twice.Code assistance
Claude Opus 5 was used for the tests
Issues
Fixes #17457