fixed people task

pull/702/head
Luke Pulverenti 11 years ago
parent e9d47569b5
commit a7de7df1da

@ -46,7 +46,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetSimilarAlbums request)
{
var result = SimilarItemsHelper.GetSimilarItems(_userManager,
var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
_itemRepo,
_libraryManager,
_userDataRepository,

@ -57,7 +57,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetSimilarGames request)
{
var result = SimilarItemsHelper.GetSimilarItems(_userManager,
var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
_itemRepo,
_libraryManager,
_userDataRepository,

@ -64,7 +64,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetSimilarMovies request)
{
var result = SimilarItemsHelper.GetSimilarItems(_userManager,
var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
_itemRepo,
_libraryManager,
_userDataRepository,

@ -89,7 +89,7 @@ namespace MediaBrowser.Api
/// <param name="includeInSearch">The include in search.</param>
/// <param name="getSimilarityScore">The get similarity score.</param>
/// <returns>ItemsResult.</returns>
internal static ItemsResult GetSimilarItems(IUserManager userManager, IItemRepository itemRepository, ILibraryManager libraryManager, IUserDataRepository userDataRepository, ILogger logger, BaseGetSimilarItems request, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
internal static ItemsResult GetSimilarItemsResult(IUserManager userManager, IItemRepository itemRepository, ILibraryManager libraryManager, IUserDataRepository userDataRepository, ILogger logger, BaseGetSimilarItems request, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
{
var user = request.UserId.HasValue ? userManager.GetUserById(request.UserId.Value) : null;
@ -125,7 +125,7 @@ namespace MediaBrowser.Api
/// <param name="includeInSearch">The include in search.</param>
/// <param name="getSimilarityScore">The get similarity score.</param>
/// <returns>IEnumerable{BaseItem}.</returns>
private static IEnumerable<BaseItem> GetSimilaritems(BaseItem item, IEnumerable<BaseItem> inputItems, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
internal static IEnumerable<BaseItem> GetSimilaritems(BaseItem item, IEnumerable<BaseItem> inputItems, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
{
inputItems = inputItems.Where(includeInSearch);

@ -57,7 +57,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetSimilarTrailers request)
{
var result = SimilarItemsHelper.GetSimilarItems(_userManager,
var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
_itemRepo,
_libraryManager,
_userDataRepository,

@ -123,7 +123,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetSimilarShows request)
{
var result = SimilarItemsHelper.GetSimilarItems(_userManager,
var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
_itemRepo,
_libraryManager,
_userDataRepository,

@ -376,14 +376,15 @@ namespace MediaBrowser.Server.Implementations.Library
// Get all user collection folders
// Skip BasePluginFolders because we already got them from RootFolder.RecursiveChildren
var userFolders =
userRootFolders.SelectMany(i => i.Children)
var userFolders = userRootFolders.SelectMany(i => i.Children)
.Where(i => !(i is BasePluginFolder))
.ToList();
items.AddRange(userFolders);
return new ConcurrentDictionary<Guid, BaseItem>(items.ToDictionary(i => i.Id));
var disctinctItems = items.DistinctBy(i => i.Id).ToList();
return new ConcurrentDictionary<Guid, BaseItem>(disctinctItems.ToDictionary(i => i.Id));
}
/// <summary>
@ -846,7 +847,7 @@ namespace MediaBrowser.Server.Implementations.Library
var tasks = new List<Task>();
var includedPersonTypes = new[] { PersonType.Actor, PersonType.Director, PersonType.GuestStar, PersonType.Writer, PersonType.Director, PersonType.Producer }
var includedPersonTypes = new[] { PersonType.Actor, PersonType.Director, PersonType.GuestStar, PersonType.Writer, PersonType.Producer }
.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
var people = RootFolder.RecursiveChildren

Loading…
Cancel
Save