Commit Graph

15 Commits

Author SHA1 Message Date
Felix Förtsch c3a7de54f3 avoid correlated item value name queries 2026-09-02 11:33:54 +02:00
Shadowghost ceeeaaab8e Fix By-Name item count handling 2026-08-27 10:19:36 +02:00
vdatanet 4adaf7f146 Fix by-name endpoints reporting TotalRecordCount=0 next to a populated Items array
`GetItemValues` -- the shared path behind `/Artists`, `/AlbumArtists`, `/Genres`,
`/MusicGenres` and `/Studios` -- disabled the total record count whenever the
query carried no `Limit`:

    if (!filter.Limit.HasValue)
    {
        filter.EnableTotalRecordCount = false;
    }

A request without an explicit limit therefore came back with N entries in `Items`
and `TotalRecordCount = 0`. Clients that page on the reported total -- the
documented contract every other list endpoint honours -- read that as an empty
library. `/Items` and `/Persons` do not share this path and report the count
correctly, which is what makes the inconsistency visible from the outside.

Measured against master with a 62-track music library:

    GET /Artists?UserId=...              -> TotalRecordCount=0  Items=5
    GET /Artists?UserId=...&limit=100    -> TotalRecordCount=5  Items=5

Dropping the block costs nothing: `representativeIds` is materialised into a
`List<Guid>` a few lines below regardless, so `.Count` was already available and
the count is now reported from it. Callers that genuinely want to skip the count
still can -- `EnableTotalRecordCount = false` is honoured as before.

The block also mutated the caller's own query object, so a query instance reused
across calls silently lost its total after the first limitless one. That is
covered by a test as well.
2026-08-05 11:34:33 +02:00
Shadowghost f3a1d56c56 Use DistinctBy where possible 2026-07-26 09:56:49 +02:00
Shadowghost 766be1e8bb Fix favorite filter performance 2026-07-25 19:09:39 +02:00
Shadowghost 9aa79682ba Reduce correlated subqueries to improve performance 2026-07-23 20:50:06 +02:00
Cody Robibero 526f4051e9 Merge pull request #16980 from TheMelmacian/feature/library_specific_language_filter_values
Improve language filters to only fetch language codes that match the requested items/libraries (follow up to #9787)
2026-07-21 20:43:31 -04:00
TheMelmacian b317af0d30 fix: remove obsolete code 2026-07-21 22:20:07 +02:00
TheMelmacian 7939f3b009 only fetch language codes for the requested library when generating filter values 2026-05-30 16:33:59 +02:00
theguymadmax ad4e884d18 Fix inaccessible artist when they exist in multiple libraries 2026-05-30 01:31:29 -04:00
Shadowghost 149649a6cf Preserve ordering in item values query 2026-05-09 02:06:01 +02:00
Shadowghost d19449e6a5 Use AsNoTracking() when only reading 2026-04-26 18:53:17 +02:00
Shadowghost fc866a64e0 Remove unnecessary materializations 2026-04-26 18:53:06 +02:00
Shadowghost ba722b4517 Optimize Search and NextUp queries 2026-03-08 15:26:35 +01:00
Shadowghost 077fa89717 Split BaseItemRepository and IItemRepository 2026-03-07 20:12:42 +01:00