added cast icon to now playing bar to send current media to another client

This commit is contained in:
Luke Pulverenti 2014-01-03 23:53:49 -05:00
parent f93fb4650c
commit f1a4832175
6 changed files with 8 additions and 56 deletions

View File

@ -64,7 +64,7 @@ namespace MediaBrowser.Api
/// <summary>
/// The _search engine
/// </summary>
private readonly ILibrarySearchEngine _searchEngine;
private readonly ISearchEngine _searchEngine;
private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService;
private readonly IImageProcessor _imageProcessor;
@ -75,7 +75,7 @@ namespace MediaBrowser.Api
/// <param name="userManager">The user manager.</param>
/// <param name="searchEngine">The search engine.</param>
/// <param name="libraryManager">The library manager.</param>
public SearchService(IUserManager userManager, ILibrarySearchEngine searchEngine, ILibraryManager libraryManager, IDtoService dtoService, IImageProcessor imageProcessor)
public SearchService(IUserManager userManager, ISearchEngine searchEngine, ILibraryManager libraryManager, IDtoService dtoService, IImageProcessor imageProcessor)
{
_userManager = userManager;
_searchEngine = searchEngine;

View File

@ -45,13 +45,6 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "PersonTypes", Description = "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string PersonTypes { get; set; }
/// <summary>
/// Search characters used to find items
/// </summary>
/// <value>The index by.</value>
[ApiMember(Name = "SearchTerm", Description = "Optional. If specified, results will be filtered based on a search term.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string SearchTerm { get; set; }
/// <summary>
/// Limit results to items containing specific genres
/// </summary>
@ -240,7 +233,7 @@ namespace MediaBrowser.Api.UserLibrary
/// The _library manager
/// </summary>
private readonly ILibraryManager _libraryManager;
private readonly ILibrarySearchEngine _searchEngine;
private readonly ISearchEngine _searchEngine;
private readonly ILocalizationManager _localization;
private readonly IDtoService _dtoService;
@ -252,7 +245,7 @@ namespace MediaBrowser.Api.UserLibrary
/// <param name="libraryManager">The library manager.</param>
/// <param name="searchEngine">The search engine.</param>
/// <param name="userDataRepository">The user data repository.</param>
public ItemsService(IUserManager userManager, ILibraryManager libraryManager, ILibrarySearchEngine searchEngine, IUserDataManager userDataRepository, ILocalizationManager localization, IDtoService dtoService)
public ItemsService(IUserManager userManager, ILibraryManager libraryManager, ISearchEngine searchEngine, IUserDataManager userDataRepository, ILocalizationManager localization, IDtoService dtoService)
{
_userManager = userManager;
_libraryManager = libraryManager;
@ -300,8 +293,6 @@ namespace MediaBrowser.Api.UserLibrary
items = items.AsEnumerable();
items = ApplySearchTerm(request, items);
items = ApplySortOrder(request, items, user, _libraryManager);
// This must be the last filter
@ -1189,24 +1180,6 @@ namespace MediaBrowser.Api.UserLibrary
return item.HasImage(imageType);
}
/// <summary>
/// Applies the search term.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="items">The items.</param>
/// <returns>IEnumerable{BaseItem}.</returns>
private IEnumerable<BaseItem> ApplySearchTerm(GetItems request, IEnumerable<BaseItem> items)
{
var term = request.SearchTerm;
if (!string.IsNullOrEmpty(term))
{
items = _searchEngine.Search(items, request.SearchTerm);
}
return items;
}
/// <summary>
/// Applies the paging.
/// </summary>

View File

@ -7,17 +7,8 @@ namespace MediaBrowser.Controller.Library
/// <summary>
/// Interface ILibrarySearchEngine
/// </summary>
public interface ILibrarySearchEngine
public interface ISearchEngine
{
/// <summary>
/// Searches items and returns them in order of relevance.
/// </summary>
/// <param name="items">The items.</param>
/// <param name="searchTerm">The search term.</param>
/// <returns>IEnumerable{BaseItem}.</returns>
/// <exception cref="System.ArgumentNullException">searchTerm</exception>
IEnumerable<BaseItem> Search(IEnumerable<BaseItem> items, string searchTerm);
/// <summary>
/// Gets the search hints.
/// </summary>

View File

@ -150,7 +150,7 @@
<Compile Include="Entities\Movies\BoxSet.cs" />
<Compile Include="Entities\Movies\Movie.cs" />
<Compile Include="Entities\Person.cs" />
<Compile Include="Library\ILibrarySearchEngine.cs" />
<Compile Include="Library\ISearchEngine.cs" />
<Compile Include="Library\ItemChangeEventArgs.cs" />
<Compile Include="Library\PlaybackProgressEventArgs.cs" />
<Compile Include="Entities\Studio.cs" />

View File

@ -14,7 +14,7 @@ namespace MediaBrowser.Server.Implementations.Library
/// Class LuceneSearchEngine
/// http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms
/// </summary>
public class LuceneSearchEngine : ILibrarySearchEngine, IDisposable
public class LuceneSearchEngine : ISearchEngine, IDisposable
{
private readonly ILibraryManager _libraryManager;
private readonly ILogger _logger;
@ -26,18 +26,6 @@ namespace MediaBrowser.Server.Implementations.Library
_logger = logManager.GetLogger("Lucene");
}
/// <summary>
/// Searches items and returns them in order of relevance.
/// </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)
{
return items;
}
public void Dispose()
{
}

View File

@ -252,7 +252,7 @@ namespace MediaBrowser.ServerApplication
ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, DirectoryWatchers, LogManager, FileSystemManager, ItemRepository);
RegisterSingleInstance(ProviderManager);
RegisterSingleInstance<ILibrarySearchEngine>(() => new LuceneSearchEngine(ApplicationPaths, LogManager, LibraryManager));
RegisterSingleInstance<ISearchEngine>(() => new LuceneSearchEngine(ApplicationPaths, LogManager, LibraryManager));
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager, UserManager);
RegisterSingleInstance(SessionManager);