fixed validation not refreshing virtual items

pull/702/head
Luke Pulverenti 11 years ago
parent 809ed093e8
commit 39e8411594

@ -8,7 +8,6 @@ using MediaBrowser.Model.Entities;
using MoreLinq;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -365,14 +364,12 @@ namespace MediaBrowser.Controller.Entities
{
var locationType = LocationType;
// Nothing to do here
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
{
return;
}
cancellationToken.ThrowIfCancellationRequested();
var validChildren = new List<Tuple<BaseItem, bool>>();
if (locationType != LocationType.Remote && locationType != LocationType.Virtual)
{
IEnumerable<BaseItem> nonCachedChildren;
try
@ -381,7 +378,7 @@ namespace MediaBrowser.Controller.Entities
}
catch (IOException ex)
{
nonCachedChildren = new BaseItem[] { };
nonCachedChildren = new BaseItem[] {};
Logger.ErrorException("Error getting file system entries for {0}", ex, Path);
}
@ -394,7 +391,6 @@ namespace MediaBrowser.Controller.Entities
var currentChildren = ActualChildren.ToDictionary(i => i.Id);
//create a list for our validated children
var validChildren = new List<Tuple<BaseItem, bool>>();
var newItems = new List<BaseItem>();
cancellationToken.ThrowIfCancellationRequested();
@ -451,10 +447,10 @@ namespace MediaBrowser.Controller.Entities
item.LocationType == LocationType.Remote)
{
// Don't remove these because there's no way to accurately validate them.
continue;
validChildren.Add(new Tuple<BaseItem, bool>(item, false));
}
if (!string.IsNullOrEmpty(item.Path) && IsPathOffline(item.Path))
else if (!string.IsNullOrEmpty(item.Path) && IsPathOffline(item.Path))
{
item.IsOffline = true;
@ -483,6 +479,11 @@ namespace MediaBrowser.Controller.Entities
await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false);
}
}
else
{
validChildren.AddRange(ActualChildren.Select(i => new Tuple<BaseItem, bool>(i, false)));
}
progress.Report(10);

Loading…
Cancel
Save