diff options
| author | Dmitry Lyzo <ashephard0@gmail.com> | 2026-08-03 21:49:52 +0300 |
|---|---|---|
| committer | Dmitry Lyzo <ashephard0@gmail.com> | 2026-08-04 16:50:13 +0300 |
| commit | 27db9c886735e278f2b8b75e3213f28a4666247d (patch) | |
| tree | d4f4ce5ae438b2cc2a8daa9dc41a3dad2ba0b22e /src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs | |
| parent | cb131ecbb704041bbb776570e31ce2a146989593 (diff) | |
| parent | 7fbc1ff8c0192b608a493324f2b7eafcf0a4383e (diff) | |
Merge remote-tracking branch 'origin/master' into is-stream-compatible
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs')
| -rw-r--r-- | src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs index 88a2c684ff..bfd0fac34a 100644 --- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; using Jellyfin.Database.Implementations.Entities; using Jellyfin.Database.Implementations.MatchCriteria; @@ -13,6 +14,14 @@ namespace Jellyfin.Database.Implementations; public static class DescendantQueryHelper { /// <summary> + /// Gets the predicate identifying items that count toward played/total aggregation: + /// real leaf media, i.e. neither folders nor virtual items (missing or unaired episodes). + /// Shared by the per-item and batched count paths so they cannot diverge. + /// </summary> + public static Expression<Func<BaseItemEntity, bool>> IsCountableLeaf { get; } = + b => !b.IsFolder && !b.IsVirtualItem; + + /// <summary> /// Gets a queryable of all descendant IDs for a parent item. /// Traverses AncestorIds and LinkedChildren to find all descendants. /// </summary> |
