aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2026-08-02 14:23:30 -0400
committerGitHub <noreply@github.com>2026-08-02 14:23:30 -0400
commitf2360c07a37b29b6fbfd53cda019c8c3235adfc0 (patch)
tree45228392602437901d95d28c55f4425e0324b8e3 /src/Jellyfin.Database/Jellyfin.Database.Implementations
parent26261dbfe7e8debc76f6bd4546bb6ef4e072bbf9 (diff)
parent4c812c9ba4b58a30c24b3cebbfdf2d33969bb3e0 (diff)
Merge pull request #17147 from Shadowghost/tmdb-missing-episodes
Add Tmdb missing episode provider
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/DescendantQueryHelper.cs9
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>