Commit Graph

234 Commits

Author SHA1 Message Date
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
brandon d6da6906a4 Batch people lookups when building item DTOs
GetBaseItemDtos already batch fetches user data, child counts, played counts
and artists before its per item loop, but AttachPeople still ran one GetPeople
query per item. Rendering a page of items (for example a large playlist) fired
one extra query per row.

Add GetPeopleByItems to IPeopleRepository, which reads every requested item in a
single query over the people mapping table and returns full PersonInfo (role,
type and sort order) grouped by item id. GetBaseItemDtos prefetches this once
when the People field is requested and passes it into AttachPeople, which reads
from the batch instead of querying per item. The single item GetBaseItemDto path
keeps its existing per item behaviour when no batch is supplied.

Adds a DtoService test asserting people resolve from the batch and the per item
GetPeople is never called.
2026-08-07 11:59:17 -04: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
Tim Eisele 63d1af5fe7 Fix similarity (#16942)
Fix similarity
2026-05-31 17:21:15 +02:00
TheMelmacian 7939f3b009 only fetch language codes for the requested library when generating filter values 2026-05-30 16:33:59 +02:00
Bond-009 2f17516d4b Merge pull request #16856 from Shadowghost/movie-recommendations
Fix movie recommendations
2026-05-27 20:59:18 +02:00
Shadowghost 97c20e6ac5 Fix movie recommendations 2026-05-15 14:37:01 +02:00
TheMelmacian 39049a726e move language filters from QueryFiltersLegacy to QueryFilters 2026-05-12 02:12:14 +02:00
Niels van Velzen d359d2f7a8 Merge pull request #16166 from Shadowghost/ignore-caching
Implement ignore rule caching
2026-05-04 17:59:48 +02:00
Niels van Velzen dcba6c3659 Merge pull request #16616 from dkanada/fix-person-limit
fix person TotalRecordCount when limit is applied
2026-05-04 17:58:27 +02:00
dkanada ec990be12a fix person TotalRecordCount when limit is applied 2026-05-04 12:06:11 +09:00
Shadowghost d20c775daf Implement ignore rule caching 2026-05-03 23:35:33 +02:00
Shadowghost a8a029de73 Fix DeleteItemsUnsafeFast usage 2026-03-11 09:16:35 +01:00
Shadowghost 2d0d497961 Update saved metadata on primary change 2026-02-25 21:03:46 +01:00
Shadowghost 3a090a5716 Optimize item count calculation for named items 2026-02-18 20:28:42 +01:00
Shadowghost 71594b4a9a Fix multiple version resolution 2026-02-08 17:22:52 +01:00
Shadowghost 2420ece5fe Fix version resolution and scan handling 2026-02-07 19:01:37 +01:00
Shadowghost 268d88a5fb Optimize Collection Grouping, NextUp and Latest queries 2026-02-07 01:38:06 +01:00
Shadowghost a0346fe5b7 Fix multiple version handling 2026-02-05 01:41:07 +01:00
Shadowghost 2789532aa8 Optimize Validator and Filter Performance 2026-01-31 19:22:04 +01:00
Shadowghost 694db80d4c Reroute on version removal 2026-01-31 19:21:36 +01:00
Shadowghost 5996c4afce Complete LinkedChildren integration and batch DTO optimizations
This commit integrates remaining performance changes:

- Add batch user data fetching in DtoService to reduce N+1 queries
- Add GetNextUpEpisodesBatch in TVSeriesManager for efficient batch retrieval
- Update Video/Movie/BoxSet to use LibraryManager for alternate versions
- Transition LinkedChild to use ItemId instead of Path (obsolete Path/LibraryItemId)
- Update providers and controllers for LinkedChildren-based references
- Add NextUpEpisodeBatchResult for batched episode queries
- Integrate IDescendantQueryProvider in SqliteDatabaseProvider
2026-01-18 19:48:46 +01:00
Collin-Swish afcaec0a89 Backport pull request #15965 from jellyfin/release-10.11.z
Add mblink creation logic to library update endpoint.

Original-merge: 22d593b8e9

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
2026-01-18 11:30:39 -05:00
MarcoCoreDuo 09edca8b7a Backport pull request #15899 from jellyfin/release-10.11.z
Fix watched state not kept on Media replace/rename

Original-merge: 8433b6d8a4

Merged-by: joshuaboniface <joshua@boniface.me>

Backported-by: Bond_009 <bond.009@outlook.com>
2026-01-18 11:30:38 -05:00
JPVenson 5a6d9180fe Add People Dedup and multiple progress fixes (#14848) 2025-09-24 15:20:30 -06:00
Cody Robibero beca405ad4 Refactor to pull item counts in a single query 2025-08-11 21:06:04 -06:00
Tim Eisele d976f13970 Recognize file changes and remove data on change (#13839) 2025-05-04 21:21:44 -06:00
JQ d06ce1f1e0 Fix only returning one item from /Item/Latest api. (#12492)
* Updated to EFcore

* Remove unused using

* Dont use DateCreated not from episode type or music type

* use TranslateQuery to filter out instead and then do the grouping and retrival of min and max datecreated instead

* Album also
2025-03-26 20:26:47 -06:00
JPVenson 42bdb22bfb Fixed namespaces 2025-03-25 16:45:00 +01:00
JPVenson 160020c551 WIP fixed namespaces 2025-03-25 15:30:22 +00:00
Tim Eisele dfb485d1f2 Rework season folder parsing (#11748) 2025-03-23 10:05:40 -06:00
Cody Robibero 85b5bebda4 Add fast-path to getting just the SeriesPresentationUniqueKey for NextUp (#13687)
* Add more optimized query to calculate series that should be processed for next up

* Filter series based on last watched date
2025-03-18 17:37:04 -06:00
Bond_009 ce76817020 Rename CreateOrUpdateItems back to CreateItems
Reverts the name change of this function made in the EFCore PR. This hopefully
reduces the amount of merge conflicts while backporting and makes it consistent
with the CreateItem function.
2025-02-09 18:30:53 +01:00
JPVenson b39553611d Applied coding style 2024-11-17 11:03:43 +00:00
JPVenson b09a41ad1f WIP porting new Repository structure 2024-10-09 10:36:08 +00:00
gnattu cd5fb84136 Backport pull request #11963 from jellyfin/release-10.9.z
Fix Library renaming

Original-merge: b78efd6b1e

Merged-by: joshuaboniface <joshua@boniface.me>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-06-06 14:30:34 -04:00
Bond-009 bb018c4adc Enable nullable for LibraryManager (#11191) 2024-04-17 10:44:50 -06:00
Cody Robibero 6fb6b5f176 Validate item access (#11171) 2024-04-14 08:18:36 -06:00
Cody Robibero f7f3ad9eb7 Precache livetv program images (#11083)
* Precache livetv program images

* return if cache hit

* use EnsureSuccessStatusCode

* Read proper bytes
2024-03-03 13:32:55 -07:00
Cody Robibero 0bc41c015f Store lyrics in the database as media streams (#9951) 2024-02-26 05:09:40 -07:00
Cody Robibero 906f701fa8 Convert CollectionType, SpecialFolderType to enum (#9764)
* Convert CollectionType, SpecialFolderType to enum

* Hide internal enum CollectionType values

* Apply suggestions from code review

Co-authored-by: Shadowghost <Shadowghost@users.noreply.github.com>

* Fix recent change

* Update Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs

Co-authored-by: Patrick Barron <barronpm@gmail.com>

---------

Co-authored-by: Shadowghost <Shadowghost@users.noreply.github.com>
Co-authored-by: Patrick Barron <barronpm@gmail.com>
2023-11-09 14:00:29 -07:00
Cody Robibero c7a94d48ae Convert ItemSortBy to enum (#9765)
* Convert ItemSortBy to enum

* Rename Unknown to Default
2023-11-09 14:00:13 -07:00
Joe Rogers e4040ab812 Allow video extras to use owner library options 2022-12-08 01:00:27 -05:00
Joshua Boniface e251f1483f Backport pull request #8167 from jellyfin/release-10.8.z
Add back library scan from library manager

Authored-by: Cody Robibero <cody@robibe.ro>

Merged-by: Bond-009 <bond.009@outlook.com>

Original-merge: f9dffa767f
2022-08-01 14:25:44 -04:00
Bond_009 adad13b865 Remove some dead code 2022-02-17 08:15:26 +01:00
Bond_009 5732e6188c Fix some warnings 2022-02-15 18:59:46 +01:00
Claus Vium 488ce51032 Remove some allocations (#7246) 2022-01-28 12:21:40 +01:00
Cody Robibero 7bfc6b5679 Remove more warnings 2021-12-27 07:38:06 -07:00
cvium 83a94aa612 Fix extras folders 2021-12-20 12:15:20 +01:00