Commit Graph

11 Commits

Author SHA1 Message Date
theguymadmax 9220c2bd63 Fix FindArtists 2026-08-11 09:40:11 -04:00
Shadowghost 26fbd1eac0 Fix master build 2026-08-10 22:46:31 +02:00
brandon 505a6ebf8f Use WhereOneOrMany helper for the alternate version id filter
Filter the parent ids with the WhereOneOrMany query helper instead of a
raw Contains so the id list is wrapped in EF.Parameter and EF Core reuses
one compiled query plan across calls, matching how the rest of the item
queries build their id filters.
2026-08-08 15:20:39 -04:00
brandon 10d108a1f4 Address review on MediaSourceCount batching
Rename GetItemsWithAlternateVersions to GetItemIdsWithAlternateVersions
across the interfaces and implementations since it returns ids. Return
the hashset straight from the query instead of materializing an array
first. Rename the DtoService guard to mayHaveAlternateVersions and
invert it so the computed path is the explicit case. Assert the media
source count value in the batch skip test and add a test covering an
item that is in the returned set still resolving to the correct count.
2026-08-08 12:33:11 -04:00
brandon c091ffdc6b Batch alternate version detection in DtoService to remove MediaSourceCount N+1
Browsing a page of videos with the MediaSourceCount field ran one alternate
version query per item, each opening a fresh DbContext. On a large library that
turned a single page into hundreds of sequential round trips and made the Items
endpoint take tens of seconds while holding a request thread the whole time.

Detect which videos own alternate versions once per page with a single query,
mirroring the existing people batch. Videos absent from that set have a single
media source, so the per item lookups are skipped for the common case. Behavior
is unchanged: a video with no alternates already resolved to a count of one.

Adds a regression test asserting the count resolves from the batch and the per
item lookups are never called.
2026-08-07 22:51:45 -04:00
Shadowghost dc300fae53 Allow duplicate LinkedChildren for Playlists 2026-07-23 13:41:51 +02:00
Sam Xie c9f71d8531 Add a collection API for Included In feature (#15516)
Add a collection API for `Included In` feature
2026-05-29 20:00:34 +02:00
Shadowghost b7b405dc83 Fix artist duplicates 2026-05-09 02:07:26 +02:00
Shadowghost 070e2b2d0c Apply review suggestions 2026-04-26 22:30:52 +02:00
Shadowghost d19449e6a5 Use AsNoTracking() when only reading 2026-04-26 18:53:17 +02:00
Shadowghost 077fa89717 Split BaseItemRepository and IItemRepository 2026-03-07 20:12:42 +01:00