diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-26 21:44:16 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-26 21:44:16 -0500 |
| commit | 88965f75e28fda4c137223476b4f0dac84967a97 (patch) | |
| tree | 7e4d08f85b125d9c4daef0c9f377d80b5ac3af91 /MediaBrowser.Controller/Entities/Folder.cs | |
| parent | dfb491fcc54cf6f32fb212d8493e83f541d05c89 (diff) | |
stop searching for dead shortcuts over and over
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 7ae2304c4..522bc3a2d 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -893,9 +893,14 @@ namespace MediaBrowser.Controller.Entities BaseItem item = null; // First get using the cached Id - if (info.ItemId != Guid.Empty) + if (info.ItemId.HasValue) { - item = LibraryManager.GetItemById(info.ItemId); + if (info.ItemId.Value == Guid.Empty) + { + return null; + } + + item = LibraryManager.GetItemById(info.ItemId.Value); } // If still null, search by path @@ -908,6 +913,9 @@ namespace MediaBrowser.Controller.Entities if (item == null) { Logger.Warn("Unable to find linked item at {0}", info.Path); + + // Don't keep searching over and over + info.ItemId = Guid.Empty; } else { @@ -985,6 +993,15 @@ namespace MediaBrowser.Controller.Entities return true; } + foreach (var child in LinkedChildren) + { + // Reset the cached value + if (child.ItemId.HasValue && child.ItemId.Value == Guid.Empty) + { + child.ItemId = null; + } + } + return false; } |
