aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Folder.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-23 15:35:58 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-23 15:35:58 -0500
commit3d4a3c9cb8f17357eb71b58313724f440b5e414c (patch)
tree50ba27b488bb0e8b86c296323bb8af00ac4a5008 /MediaBrowser.Controller/Entities/Folder.cs
parent88b4a8f6e63c8007320bcbfd61f3a718c4793466 (diff)
change cast icon state appropriately
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index b56abcc80..e682a0d2f 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -375,6 +375,28 @@ namespace MediaBrowser.Controller.Entities
}
}
+ private Dictionary<Guid, BaseItem> GetActualChildrenDictionary()
+ {
+ var dictionary = new Dictionary<Guid, BaseItem>();
+
+ foreach (var child in ActualChildren)
+ {
+ var id = child.Id;
+ if (dictionary.ContainsKey(id))
+ {
+ Logger.Error( "Found folder containing items with duplicate id. Path: {0}, Child Name: {1}",
+ Path ?? Name,
+ child.Path ?? child.Name);
+ }
+ else
+ {
+ dictionary[id] = child;
+ }
+ }
+
+ return dictionary;
+ }
+
/// <summary>
/// Validates the children internal.
/// </summary>
@@ -413,7 +435,7 @@ namespace MediaBrowser.Controller.Entities
progress.Report(5);
//build a dictionary of the current children we have now by Id so we can compare quickly and easily
- var currentChildren = ActualChildren.ToDictionary(i => i.Id);
+ var currentChildren = GetActualChildrenDictionary();
//create a list for our validated children
var newItems = new List<BaseItem>();