private async Task <bool> GetArtists() { var query = new ArtistsQuery { SortBy = new [] { "SortName" }, SortOrder = SortOrder.Ascending, Recursive = true, UserId = AuthenticationService.Current.LoggedInUser.Id }; try { var itemsResponse = await _apiClient.GetArtistsAsync(query); if (itemsResponse == null) { return(false); } var items = itemsResponse.Items.ToList(); Artists = await Utils.GroupItemsByName(items); return(true); } catch (HttpException ex) { Log.ErrorException("GetArtists()", ex); } return(false); }
private Task <ItemsResult> GetFavoriteArtists(ItemListViewModel viewModel, DisplayPreferences displayPreferences) { var query = new ArtistsQuery { 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.GetArtistsAsync(query)); }
private async Task GetArtistInfo() { try { Log.Info("Getting information for Artist [{0}] ({1})", SelectedArtist.Name, SelectedArtist.Id); var artistQuery = new ArtistsQuery { }; SelectedArtist = await _apiClient.GetItemAsync(SelectedArtist.Id, AuthenticationService.Current.LoggedInUser.Id); } catch (HttpException ex) { Log.ErrorException("GetArtistInfo()", ex); } _gotAlbums = await GetAlbums(); await GetArtistTracks(); await SortTracks(); }
private async Task <bool> GetArtists() { var query = new ArtistsQuery { ParentId = _parentId, SortBy = new[] { "SortName" }, Fields = new[] { ItemFields.SortName, ItemFields.MediaSources, ItemFields.SyncInfo, }, SortOrder = SortOrder.Ascending, Recursive = true, UserId = AuthenticationService.Current.LoggedInUserId, ImageTypeLimit = 1, EnableImageTypes = new[] { ImageType.Backdrop, ImageType.Primary, } }; try { var itemsResponse = await ApiClient.GetAlbumArtistsAsync(query); if (itemsResponse == null) { return(false); } var items = itemsResponse.Items.ToList(); Artists = await Utils.GroupItemsByName(items); return(true); } catch (HttpException ex) { Utils.HandleHttpException("GetArtists()", ex, NavigationService, Log); } return(false); }
private async Task<bool> GetArtists() { var query = new ArtistsQuery { SortBy = new []{"SortName"}, SortOrder = SortOrder.Ascending, Recursive = true, UserId = AuthenticationService.Current.LoggedInUser.Id }; try { var itemsResponse = await _apiClient.GetArtistsAsync(query); if (itemsResponse == null) { return false; } var items = itemsResponse.Items.ToList(); Artists = await Utils.GroupItemsByName(items); return true; } catch (HttpException ex) { Log.ErrorException("GetArtists()", ex); } return false; }
private async Task<bool> GetArtists() { var query = new ArtistsQuery { SortBy = new[] {"SortName"}, Fields = new[] {ItemFields.SortName, ItemFields.MediaSources}, SortOrder = SortOrder.Ascending, Recursive = true, UserId = AuthenticationService.Current.LoggedInUserId, ImageTypeLimit = 1, EnableImageTypes = new[] {ImageType.Backdrop, ImageType.Primary,} }; try { var itemsResponse = await ApiClient.GetAlbumArtistsAsync(query); if (itemsResponse == null) { return false; } var items = itemsResponse.Items.ToList(); Artists = await Utils.GroupItemsByName(items); return true; } catch (HttpException ex) { Utils.HandleHttpException("GetArtists()", ex, NavigationService, Log); } return false; }
private Task<ItemsResult> GetFavoriteArtists(ItemListViewModel viewModel, DisplayPreferences displayPreferences) { var query = new ArtistsQuery { 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.GetArtistsAsync(query); }