diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs
index 078b3c664c..6f9836448c 100644
--- a/MediaBrowser.Controller/Dto/DtoBuilder.cs
+++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs
@@ -277,12 +277,16 @@ namespace MediaBrowser.Controller.Dto
if (item.IsFolder)
{
- if (fields.Contains(ItemFields.ItemCounts))
+ var hasItemCounts = fields.Contains(ItemFields.ItemCounts);
+
+ if (hasItemCounts || fields.Contains(ItemFields.CumulativeRunTimeTicks))
{
var folder = (Folder)item;
- // Skip sorting since all we want is a count
- dto.ChildCount = folder.GetChildren(user, true).Count();
+ if (hasItemCounts)
+ {
+ dto.ChildCount = folder.GetChildren(user, true).Count();
+ }
SetSpecialCounts(folder, user, dto, _userDataRepository);
}
@@ -749,6 +753,7 @@ namespace MediaBrowser.Controller.Dto
var rcentlyAddedItemCount = 0;
var recursiveItemCount = 0;
var unplayed = 0;
+ long runtime = 0;
double totalPercentPlayed = 0;
@@ -788,6 +793,8 @@ namespace MediaBrowser.Controller.Dto
{
unplayed++;
}
+
+ runtime += child.RunTimeTicks ?? 0;
}
dto.RecursiveItemCount = recursiveItemCount;
@@ -798,6 +805,11 @@ namespace MediaBrowser.Controller.Dto
{
dto.PlayedPercentage = totalPercentPlayed / recursiveItemCount;
}
+
+ if (runtime > 0)
+ {
+ dto.CumulativeRunTimeTicks = runtime;
+ }
}
///
@@ -833,7 +845,9 @@ namespace MediaBrowser.Controller.Dto
)).ConfigureAwait(false);
- var dictionary = entities.Where(i => i != null).ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
+ var dictionary = entities.Where(i => i != null)
+ .Distinct()
+ .ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
for (var i = 0; i < people.Count; i++)
{
diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs
index d57c354f7d..9564bf5a8c 100644
--- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs
+++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs
@@ -24,6 +24,7 @@ namespace MediaBrowser.Controller.Resolvers
".m2ts",
".img",
".iso",
+ ".mk3d",
".ts",
".rmvb",
".mov",
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index d6217c1e78..1c0fbed07e 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -113,6 +113,12 @@ namespace MediaBrowser.Model.Dto
///
/// The original run time ticks.
public long? OriginalRunTimeTicks { get; set; }
+
+ ///
+ /// Gets or sets the cumulative run time ticks.
+ ///
+ /// The cumulative run time ticks.
+ public long? CumulativeRunTimeTicks { get; set; }
///
/// Gets or sets the run time ticks.
diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs
index 4e412d0ac3..b39325fe23 100644
--- a/MediaBrowser.Model/Querying/ItemFields.cs
+++ b/MediaBrowser.Model/Querying/ItemFields.cs
@@ -21,6 +21,11 @@ namespace MediaBrowser.Model.Querying
///
CriticRatingSummary,
+ ///
+ /// The cumulative run time ticks
+ ///
+ CumulativeRunTimeTicks,
+
///
/// The custom rating
///