added cast icon to now playing bar to send current media to another client
This commit is contained in:
parent
f93fb4650c
commit
f1a4832175
|
@ -64,7 +64,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _search engine
|
/// The _search engine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILibrarySearchEngine _searchEngine;
|
private readonly ISearchEngine _searchEngine;
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IDtoService _dtoService;
|
private readonly IDtoService _dtoService;
|
||||||
private readonly IImageProcessor _imageProcessor;
|
private readonly IImageProcessor _imageProcessor;
|
||||||
|
@ -75,7 +75,7 @@ namespace MediaBrowser.Api
|
||||||
/// <param name="userManager">The user manager.</param>
|
/// <param name="userManager">The user manager.</param>
|
||||||
/// <param name="searchEngine">The search engine.</param>
|
/// <param name="searchEngine">The search engine.</param>
|
||||||
/// <param name="libraryManager">The library manager.</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;
|
_userManager = userManager;
|
||||||
_searchEngine = searchEngine;
|
_searchEngine = searchEngine;
|
||||||
|
|
|
@ -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")]
|
[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; }
|
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>
|
/// <summary>
|
||||||
/// Limit results to items containing specific genres
|
/// Limit results to items containing specific genres
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -240,7 +233,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// The _library manager
|
/// The _library manager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly ILibrarySearchEngine _searchEngine;
|
private readonly ISearchEngine _searchEngine;
|
||||||
private readonly ILocalizationManager _localization;
|
private readonly ILocalizationManager _localization;
|
||||||
|
|
||||||
private readonly IDtoService _dtoService;
|
private readonly IDtoService _dtoService;
|
||||||
|
@ -252,7 +245,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="libraryManager">The library manager.</param>
|
/// <param name="libraryManager">The library manager.</param>
|
||||||
/// <param name="searchEngine">The search engine.</param>
|
/// <param name="searchEngine">The search engine.</param>
|
||||||
/// <param name="userDataRepository">The user data repository.</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;
|
_userManager = userManager;
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
|
@ -300,8 +293,6 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
|
|
||||||
items = items.AsEnumerable();
|
items = items.AsEnumerable();
|
||||||
|
|
||||||
items = ApplySearchTerm(request, items);
|
|
||||||
|
|
||||||
items = ApplySortOrder(request, items, user, _libraryManager);
|
items = ApplySortOrder(request, items, user, _libraryManager);
|
||||||
|
|
||||||
// This must be the last filter
|
// This must be the last filter
|
||||||
|
@ -1189,24 +1180,6 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
return item.HasImage(imageType);
|
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>
|
/// <summary>
|
||||||
/// Applies the paging.
|
/// Applies the paging.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -7,17 +7,8 @@ namespace MediaBrowser.Controller.Library
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface ILibrarySearchEngine
|
/// Interface ILibrarySearchEngine
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Gets the search hints.
|
/// Gets the search hints.
|
||||||
/// </summary>
|
/// </summary>
|
|
@ -150,7 +150,7 @@
|
||||||
<Compile Include="Entities\Movies\BoxSet.cs" />
|
<Compile Include="Entities\Movies\BoxSet.cs" />
|
||||||
<Compile Include="Entities\Movies\Movie.cs" />
|
<Compile Include="Entities\Movies\Movie.cs" />
|
||||||
<Compile Include="Entities\Person.cs" />
|
<Compile Include="Entities\Person.cs" />
|
||||||
<Compile Include="Library\ILibrarySearchEngine.cs" />
|
<Compile Include="Library\ISearchEngine.cs" />
|
||||||
<Compile Include="Library\ItemChangeEventArgs.cs" />
|
<Compile Include="Library\ItemChangeEventArgs.cs" />
|
||||||
<Compile Include="Library\PlaybackProgressEventArgs.cs" />
|
<Compile Include="Library\PlaybackProgressEventArgs.cs" />
|
||||||
<Compile Include="Entities\Studio.cs" />
|
<Compile Include="Entities\Studio.cs" />
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
/// Class LuceneSearchEngine
|
/// Class LuceneSearchEngine
|
||||||
/// http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms
|
/// http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LuceneSearchEngine : ILibrarySearchEngine, IDisposable
|
public class LuceneSearchEngine : ISearchEngine, IDisposable
|
||||||
{
|
{
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
@ -26,18 +26,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
_logger = logManager.GetLogger("Lucene");
|
_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()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ namespace MediaBrowser.ServerApplication
|
||||||
ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, DirectoryWatchers, LogManager, FileSystemManager, ItemRepository);
|
ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, DirectoryWatchers, LogManager, FileSystemManager, ItemRepository);
|
||||||
RegisterSingleInstance(ProviderManager);
|
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);
|
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager, UserManager);
|
||||||
RegisterSingleInstance(SessionManager);
|
RegisterSingleInstance(SessionManager);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user