Commit Graph

59 Commits

Author SHA1 Message Date
Cody Robibero beca405ad4 Refactor to pull item counts in a single query 2025-08-11 21:06:04 -06:00
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
JPVenson 439a997fca Readded custom serialisation 2024-10-10 18:01:14 +00:00
JPVenson b09a41ad1f WIP porting new Repository structure 2024-10-09 10:36:08 +00:00
Bond-009 2b1a915ead Merge pull request #7604 from Jellifi007/fixes-diactritics
Co-authored-by: Cody Robibero <cody@robibe.ro>
(cherry picked from commit 8d1d973438)
Signed-off-by: crobibero <cody@robibe.ro>
2022-05-20 18:30:56 -04:00
Cody Robibero 32629cd7da Use BaseItemKind where possible 2021-12-12 06:11:27 -07:00
Bond_009 981cf4cfa0 Remove our own RemoveDiacritcs string extension in favor of Diacritics.Net 2021-06-22 09:48:40 +02:00
Cody Robibero d461e3912a Remove warninigs from MediaBrowser.Controller (Part 3) (#6078)
Co-authored-by: Bond-009 <bond.009@outlook.com>
2021-06-06 17:16:41 +02:00
crobibero 6bcbc2b88a Reduce warnings in MediaBrowser.Controller 2021-05-13 07:33:11 -06:00
Cody Robibero e3f55a0c54 Reduce warnings in MediaBrowser.Controller (#6006)
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
2021-05-11 13:55:46 +02:00
Bond_009 fb090df0b5 Enable nullable reference types for MediaBrowser.Controller 2021-05-07 00:39:20 +02:00
Bond_009 5a9c218324 Fix build 2020-10-17 16:27:31 +02:00
Bond_009 49569ca0a0 Use nameof where possible 2020-10-17 16:19:57 +02:00
Bond_009 404bb4f835 Enable TreatWarningsAsErrors for MediaBrowser.Controller in Release 2020-08-22 21:56:24 +02:00
Bond-009 9af6eda0b4 Merge pull request #3343 from telans/comment-stops
Add full stop at end of comments (SA1629)
2020-06-16 11:54:58 +02:00
telans 247f9c61e6 fix SA1513/SA1516 2020-06-16 16:11:30 +12:00
telans 9018f8d8be Add full stop at end of comments (SA1629) 2020-06-16 10:37:52 +12:00
Bond_009 5edb8159a7 Fix Json serialization error 2019-10-15 17:49:49 +02:00
Claus Vium 8985fb8d58 Remove support for games as a media type 2019-01-31 19:04:47 +01:00
Erwin de Haan a36658f6f0 ReSharper Reformat: Properties to expression bodied form. 2019-01-13 21:31:14 +01:00
Erwin de Haan ba610b5094 Find+Sed BOM removal *.cs: Jellyfin.Server-MediaBrowser.Controller 2019-01-13 21:01:16 +01:00
Erwin de Haan 26ca4b607b Visual Studio Reformat: MediaBrowser.Controller 2019-01-13 20:25:32 +01:00
Bond_009 b1ccd6bad9 Fix build post GPL change 2018-12-30 22:44:39 +01:00
Andrew Rabert a86b71899e Add GPL modules 2018-12-27 18:27:57 -05:00
stefan 48facb797e Update to 3.5.2 and .net core 2.1 2018-09-12 19:26:21 +02:00
Luke Pulverenti 31b01cbb56 add fixes for dng images 2017-09-22 16:33:01 -04:00
Luke Pulverenti e441e2f53d update active recordings 2017-08-24 15:52:19 -04:00
Luke Pulverenti da77b05817 update data queries 2017-05-21 03:25:49 -04:00
Luke Pulverenti da39d9a5bf update folder queries 2017-04-27 14:12:44 -04:00
Luke Pulverenti b38b7a7062 rework filestream 2017-03-13 00:08:23 -04:00
Luke Pulverenti 3edf91ce56 update music artists 2017-01-05 23:38:03 -05:00
Luke Pulverenti 62f84acd26 fix auto-organize 2016-11-21 13:49:07 -05:00
Luke Pulverenti ef6b90b8e6 make controller project portable 2016-10-25 15:02:04 -04:00
Luke Pulverenti 0f8ccfaf49 prep for portable common 2016-10-23 15:47:34 -04:00
Luke Pulverenti 07791d46a5 rework scheduled tasks in preparation of common project going portable 2016-10-23 15:14:57 -04:00
Luke Pulverenti cc62faa1c2 update season queries 2016-08-18 01:56:10 -04:00
Luke Pulverenti d9ee4f81fd rework storage of PresentationUniqueKey 2016-08-12 15:11:45 -04:00
Luke Pulverenti f9847be17c update item by name queries 2016-06-17 09:06:13 -04:00
Luke Pulverenti 6adc668bed update icons 2016-05-07 13:47:41 -04:00
Luke Pulverenti 6330b13262 support multiple user data keys 2016-04-30 19:05:21 -04:00
Luke Pulverenti b1be09242c update people saving 2015-06-28 21:10:45 -04:00
Luke Pulverenti d451386f5d sync updates 2015-02-18 23:37:44 -05:00
Luke Pulverenti b6d59c7688 fixes #1001 - Support downloading 2015-02-06 00:39:07 -05:00
Luke Pulverenti f5919990c9 fix failing scan 2015-01-26 17:47:16 -05:00
Luke Pulverenti a1a56557ec sync updates 2015-01-25 01:34:50 -05:00
Luke Pulverenti 6755937800 sync updates 2015-01-24 17:33:26 -05:00
Luke Pulverenti d494944767 calculate item by name counts on the fly 2014-03-09 18:14:44 -04:00
Luke Pulverenti 12757d094b use music brainz values from audio files with bottom up refresh 2014-02-07 17:40:03 -05:00
Luke Pulverenti 44c0eba39d abstract preferred metadata language per item 2013-12-26 19:23:58 -05:00
Luke Pulverenti 245e92c9cc updated nuget 2013-12-02 16:46:22 -05:00