<feed xmlns='http://www.w3.org/2005/Atom'>
<title>jellyfin/tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryByNameTotalCountTests.cs, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.lodewillems.com/jellyfin/atom?h=master</id>
<link rel='self' href='https://git.lodewillems.com/jellyfin/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.lodewillems.com/jellyfin/'/>
<updated>2026-08-05T09:34:33Z</updated>
<entry>
<title>Fix by-name endpoints reporting TotalRecordCount=0 next to a populated Items array</title>
<updated>2026-08-05T09:34:33Z</updated>
<author>
<name>vdatanet</name>
<email>joan@vdata.net</email>
</author>
<published>2026-08-05T09:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.lodewillems.com/jellyfin/commit/?id=4adaf7f146ee895d714ae87af6858101bb10e505'/>
<id>urn:sha1:4adaf7f146ee895d714ae87af6858101bb10e505</id>
<content type='text'>
`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=...              -&gt; TotalRecordCount=0  Items=5
    GET /Artists?UserId=...&amp;limit=100    -&gt; TotalRecordCount=5  Items=5

Dropping the block costs nothing: `representativeIds` is materialised into a
`List&lt;Guid&gt;` 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.
</content>
</entry>
</feed>
