diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-03-01 14:43:03 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-03-01 14:43:03 -0500 |
| commit | 6b1f786a445ae9e44d4d5c247c541892840ce8c1 (patch) | |
| tree | 3e90db7a51229bea538bd15b96296319b6b4d043 /MediaBrowser.Server.Implementations/Library/LibraryManager.cs | |
| parent | 076a07a54661da993b7ecefd5e294b11b8d90873 (diff) | |
update FindByPath
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index f0ee364b4..721603efe 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -795,12 +795,18 @@ namespace MediaBrowser.Server.Implementations.Library Path = path }; + // Only use the database result if there's exactly one item, otherwise we run the risk of returning old data that hasn't been cleaned yet. var items = GetItemIds(query).Select(GetItemById).Where(i => i != null).ToArray(); if (items.Length == 1) { return items[0]; } + + if (items.Length == 0) + { + return null; + } return RootFolder.FindByPath(path); } |
