private Task<ItemsResult> GetAllActors(ItemListViewModel viewModel, DisplayPreferences displayPreferences) { var fields = FolderPage.QueryFields.ToList(); fields.Remove(ItemFields.Overview); fields.Remove(ItemFields.DisplayPreferencesId); fields.Remove(ItemFields.DateCreated); var query = new PersonsQuery { Fields = fields.ToArray(), IncludeItemTypes = new[] { "Movie", "Trailer" }, SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy) ? new[] { displayPreferences.SortBy } : new[] { ItemSortBy.SortName }, SortOrder = displayPreferences.SortOrder, UserId = _sessionManager.CurrentUser.Id, Recursive = true }; var indexOption = viewModel.CurrentIndexOption; if (indexOption != null) { if (string.Equals(indexOption.Name, "#", StringComparison.OrdinalIgnoreCase)) { query.NameLessThan = "A"; } else { query.NameStartsWithOrGreater = indexOption.Name; query.NameLessThan = indexOption.Name + "zz"; } } return ApiClient.GetPeopleAsync(query); }
public IEnumerable<BaseItem> RetrievePersons(PersonsQuery query) { var dtos = Kernel.ApiClient.GetPersons(query); return dtos == null ? new BaseItem[] {} : dtos.Items.Select(dto => GetItem(dto, dto.Type)).Where(item => item != null); }
private Task<ItemsResult> GetFavoritePeople(ItemListViewModel viewModel, DisplayPreferences displayPreferences) { var query = new PersonsQuery { Fields = FolderPage.QueryFields, UserId = _sessionManager.CurrentUser.Id, SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy) ? new[] { displayPreferences.SortBy } : new[] { ItemSortBy.SortName }, SortOrder = displayPreferences.SortOrder, Recursive = true, Filters = new[] { ItemFilter.IsFavorite } }; return ApiClient.GetPeopleAsync(query); }