aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs25
-rw-r--r--MediaBrowser.Controller/Entities/Movies/BoxSet.cs2
3 files changed, 24 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 0104db305..05ab35d9a 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -588,7 +588,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the community rating vote count.
/// </summary>
/// <value>The community rating vote count.</value>
- public int VoteCount { get; set; }
+ public int? VoteCount { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 8605c7125..549ce06a5 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -91,7 +91,7 @@ namespace MediaBrowser.Controller.Entities
public List<LinkedChild> LinkedChildren { get; set; }
- protected virtual bool SupportsLinkedChildren
+ protected virtual bool SupportsShortcutChildren
{
get { return false; }
}
@@ -856,6 +856,7 @@ namespace MediaBrowser.Controller.Entities
{
var parent = System.IO.Path.GetDirectoryName(path);
+ // Depending on whether the path is local or unc, it may return either null or '\' at the top
while (!string.IsNullOrEmpty(parent) && !parent.ToCharArray()[0].Equals(System.IO.Path.DirectorySeparatorChar))
{
if (Directory.Exists(parent))
@@ -999,15 +1000,32 @@ namespace MediaBrowser.Controller.Entities
public IEnumerable<BaseItem> GetLinkedChildren()
{
return LinkedChildren
- .Select(i => LibraryManager.RootFolder.FindByPath(i.Path))
+ .Select(GetLinkedChild)
.Where(i => i != null);
}
+ /// <summary>
+ /// Gets the linked child.
+ /// </summary>
+ /// <param name="info">The info.</param>
+ /// <returns>BaseItem.</returns>
+ private BaseItem GetLinkedChild(LinkedChild info)
+ {
+ var item = LibraryManager.RootFolder.FindByPath(info.Path);
+
+ if (item == null)
+ {
+ Logger.Warn("Unable to find linked item at {0}", info.Path);
+ }
+
+ return item;
+ }
+
public override async Task<bool> RefreshMetadata(CancellationToken cancellationToken, bool forceSave = false, bool forceRefresh = false, bool allowSlowProviders = true, bool resetResolveArgs = true)
{
var changed = await base.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders, resetResolveArgs).ConfigureAwait(false);
- return changed || (SupportsLinkedChildren && LocationType == LocationType.FileSystem && RefreshLinkedChildren());
+ return changed || (SupportsShortcutChildren && LocationType == LocationType.FileSystem && RefreshLinkedChildren());
}
/// <summary>
@@ -1059,6 +1077,7 @@ namespace MediaBrowser.Controller.Entities
if (!newShortcutLinks.SequenceEqual(currentShortcutLinks))
{
+ Logger.Info("Shortcut links have changed for {0}", Path);
newShortcutLinks.AddRange(currentManualLinks);
LinkedChildren = newShortcutLinks;
return true;
diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
index 2ee3ccffe..5c99a62f7 100644
--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs
@@ -6,7 +6,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// </summary>
public class BoxSet : Folder
{
- protected override bool SupportsLinkedChildren
+ protected override bool SupportsShortcutChildren
{
get
{