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 MoreLinq;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -365,14 +364,12 @@ namespace MediaBrowser.Controller.Entities
{ {
var locationType = LocationType; var locationType = LocationType;
// Nothing to do here
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
{
return;
}
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
var validChildren = new List<Tuple<BaseItem, bool>>();
if (locationType != LocationType.Remote && locationType != LocationType.Virtual)
{
IEnumerable<BaseItem> nonCachedChildren; IEnumerable<BaseItem> nonCachedChildren;
try try
@ -394,7 +391,6 @@ namespace MediaBrowser.Controller.Entities
var currentChildren = ActualChildren.ToDictionary(i => i.Id); var currentChildren = ActualChildren.ToDictionary(i => i.Id);
//create a list for our validated children //create a list for our validated children
var validChildren = new List<Tuple<BaseItem, bool>>();
var newItems = new List<BaseItem>(); var newItems = new List<BaseItem>();
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
@ -451,10 +447,10 @@ namespace MediaBrowser.Controller.Entities
item.LocationType == LocationType.Remote) item.LocationType == LocationType.Remote)
{ {
// Don't remove these because there's no way to accurately validate them. // 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; item.IsOffline = true;
@ -483,6 +479,11 @@ namespace MediaBrowser.Controller.Entities
await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false); 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); progress.Report(10);

Loading…
Cancel
Save