resolve search returning missing episodes

pull/702/head
Luke Pulverenti 10 years ago
parent 34be2effa1
commit 0a8291d39b

@ -1,5 +1,6 @@
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
@ -105,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (query.IncludeMedia) if (query.IncludeMedia)
{ {
// Add search hints based on item name // Add search hints based on item name
hints.AddRange(items.Where(i => !string.IsNullOrWhiteSpace(i.Name)).Select(item => hints.AddRange(items.Where(i => !string.IsNullOrWhiteSpace(i.Name) && IncludeInSearch(i)).Select(item =>
{ {
var index = GetIndex(item.Name, searchTerm, terms); var index = GetIndex(item.Name, searchTerm, terms);
@ -289,6 +290,20 @@ namespace MediaBrowser.Server.Implementations.Library
return Task.FromResult(returnValue); return Task.FromResult(returnValue);
} }
private bool IncludeInSearch(BaseItem item)
{
var episode = item as Episode;
if (episode != null)
{
if (episode.IsVirtualUnaired || episode.IsMissingEpisode)
{
return false;
}
}
return true;
}
/// <summary> /// <summary>
/// Gets the index. /// Gets the index.
/// </summary> /// </summary>

Loading…
Cancel
Save