jellyfin/Emby.Server.Implementations
Evan 0a4ff3f3c0 Fix GetBaseItemDto to return related item counts via SQL count
For API call /Items/{item id} GetBaseItemDto will return the counts of related items e.g. artists, albums, songs.  GetBaseItemDto currently does this by calling GetTaggedItems which retrieves the objects into memory to count them.  Replace with SQL count.

Fixes:
This should be an improvement for any large libraries, but especially large music libraries.  Example:

Request Library -> Genres -> any very popular genre in your large library, e.g. Classical
Number of albums = 1552, songs = 23515, ...

- Before change: Try to retrieve 1552 albums, 23515 songs, ... in memory, API never returns, database on fire
- After change: API returns in 367ms and Genre view opens with 200 albums in 2 seconds

I verified the numbers returned are correct but note that there is a bug somewhere else in Jellyfin that is setting TopParentId to NULL for a large portion of my MusicArtists, which causes them to not be counted by the existing GetCount().  This is not related to this change, also happens with the existing code, and does not seem to affect the Web UI.

Includes Cory's changes in:
- https://github.com/jellyfin/jellyfin/pull/14610#issuecomment-3172211468
- https://github.com/jellyfin/jellyfin/pull/14610#issuecomment-3172239154
2025-08-10 18:02:17 +08:00
..
AppBase Add Full system backup feature (#13945) 2025-05-18 18:39:04 -06:00
Branding
Chapters Merge pull request #13847 from Shadowghost/rework-chapter-management 2025-04-26 14:01:12 +02:00
Collections Recognize file changes and remove data on change (#13839) 2025-05-04 21:21:44 -06:00
Configuration
Cryptography
Data Fix extracted data cleanup in cleanup post scan task (#14083) 2025-05-11 21:11:21 -06:00
Devices
Dto Fix GetBaseItemDto to return related item counts via SQL count 2025-08-10 18:02:17 +08:00
EntryPoints Fixed namespaces 2025-03-25 16:45:00 +01:00
HttpServer Fix modification checks and make sure to use UTC (#14347) 2025-06-26 17:50:37 -06:00
Images Fix modification checks and make sure to use UTC (#14347) 2025-06-26 17:50:37 -06:00
IO Fix cross filesystem dir moving (#14063) 2025-05-05 14:22:43 -06:00
Library Merge pull request #14410 from dyphire/language 2025-08-03 17:29:40 -04:00
Localization Translated using Weblate (English (Pirate)) 2025-08-07 01:15:12 +00:00
Playlists Recognize file changes and remove data on change (#13839) 2025-05-04 21:21:44 -06:00
Plugins Fix modification checks and make sure to use UTC (#14347) 2025-06-26 17:50:37 -06:00
Properties
QuickConnect
ScheduledTasks Add progress reporting to AudioNormalizationTask. (#14306) 2025-07-27 19:27:24 -06:00
Serialization
Session Use RequestHelpers.GetSession in SessionWebSocketListener (#14494) 2025-07-20 20:00:47 -06:00
Sorting Fix modification checks and make sure to use UTC (#14347) 2025-06-26 17:50:37 -06:00
SyncPlay Return SyncPlay group info after creation, add GET group endpoint (#13935) 2025-04-20 19:40:23 -06:00
TV Fixed namespaces 2025-03-25 16:45:00 +01:00
Updates chore: fix spelling 2025-01-25 20:05:15 -05:00
ApplicationHost.cs Use proper scheduler that honors the parallel task limit (#14281) 2025-06-15 15:21:11 -06:00
ConfigurationOptions.cs
Emby.Server.Implementations.csproj Add .gitignore style ignoring (#13906) 2025-04-26 09:35:57 -06:00
IStartupOptions.cs
ServerApplicationPaths.cs Check for path overlaps (#12832) 2025-04-26 09:30:25 -06:00
SystemManager.cs Ignore null key virtual folders (#14253) 2025-06-09 06:20:04 -06:00