mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
Moved search placeholder
This commit is contained in:
@@ -817,21 +817,5 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
return comparer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the specified items.
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
/// <param name="searchTerm">The search term.</param>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
public IEnumerable<BaseItem> Search(IEnumerable<BaseItem> items, string searchTerm)
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchTerm))
|
||||
{
|
||||
throw new ArgumentNullException("searchTerm");
|
||||
}
|
||||
|
||||
return items.Where(i => i.Name.StartsWith(searchTerm, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// Class LuceneSearchEngine
|
||||
/// http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms
|
||||
/// </summary>
|
||||
public class LuceneSearchEngine : ILibrarySearchEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// Sorts the specified items.
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
/// <param name="searchTerm">The search term.</param>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">searchTerm</exception>
|
||||
public IEnumerable<BaseItem> Search(IEnumerable<BaseItem> items, string searchTerm)
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchTerm))
|
||||
{
|
||||
throw new ArgumentNullException("searchTerm");
|
||||
}
|
||||
|
||||
return items.Where(i => i.Name.StartsWith(searchTerm, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,7 @@
|
||||
<Compile Include="IO\DirectoryWatchers.cs" />
|
||||
<Compile Include="Library\CoreResolutionIgnoreRule.cs" />
|
||||
<Compile Include="Library\LibraryManager.cs" />
|
||||
<Compile Include="Library\LuceneSearchEngine.cs" />
|
||||
<Compile Include="Library\ResolverHelper.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\AudioResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\MusicAlbumResolver.cs" />
|
||||
|
||||
Reference in New Issue
Block a user