private IEnumerable<TrackContainer> GetAlbums(ArtistModel artist)
        {
            var albumsByArtist = new List<TrackContainer>();
            var albumsContainingArtist = new List<TrackContainer>();
            var albums = Radio.GetAlbumsByArtist(artist.Name).ToArray();

            foreach (var album in albums)
            {
                if (album.Tracks.All(t => t.Artist.Equals(artist.Name, StringComparison.InvariantCultureIgnoreCase)))
                {
                    albumsByArtist.Add(album);
                }
                else
                {
                    albumsContainingArtist.Add(album);
                }
            }

            if (!albums.Any())
            {
                ToastService.Show(new ToastData
                {
                    Message = "No search results found for " + artist.Name,
                    Icon = AppIcons.Information
                });
            }

            return albumsByArtist
                .OrderBy(a => a.Name)
                .ThenBy(a => a.Year)
                .Concat(albumsContainingArtist
                .OrderBy(a => a.Name)
                .ThenBy(a => a.Year)).ToArray();
        }
        void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
        {
            CurrentArtist = new ArtistModel();
            CurrentArtist.Name = navigationContext.Parameters["artistName"];

            // Retrieve artist information
            Task.Factory.StartNew(state =>
            {
                var artist = (ArtistModel)state;
                using(LoadingIndicatorService.EnterLoadingBlock())
                {
                    using(var session = new EchoNestSession(EchoNestModule.ApiKey))
                    {
                        var response = session.Query<Profile>().Execute(artist.Name,
                            ArtistBucket.Images |
                            ArtistBucket.YearsActive |
                            ArtistBucket.Biographies);

                        if (response != null && response.Status.Code == ResponseCode.Success)
                        {
                            var image = response.Artist.Images.FirstOrDefault();
                            if (image != null)
                            {
                                artist.ArtistInfo.Image = image.Url;
                            }

                            var biography = response.Artist.Biographies.OrderByDescending(b => b.Text.Length).FirstOrDefault();
                            if (biography != null)
                            {
                                artist.ArtistInfo.Biography = biography.Text;
                            }

                            if (response.Artist.YearsActive.Count > 0)
                            {
                                var @select = response.Artist.YearsActive.Select(t => t.Start + "-" + (t.End.HasValue ? t.End.Value.ToString() : string.Empty));
                                artist.ArtistInfo.YearsActive = string.Join(", ", @select);
                            }
                        }
                    }
                }

                artist.ArtistInfo.Owner = new TrackContainerOwner(CurrentArtist.Name);
            }, CurrentArtist)
            .ContinueWith(task =>
            {
                if (task.IsFaulted && task.Exception != null)
                {
                    task.Exception.Handle(e =>
                    {
                        Logger.Log(e.ToString(), Category.Exception, Priority.Medium);
                        return true;
                    });
                }
            });

            // Retrieve albums
            Task.Factory
              .StartNew(state =>
              {
                  var artist = (ArtistModel)state;
                  using (LoadingIndicatorService.EnterLoadingBlock())
                  {
                      artist.Albums = GetAlbums(artist);
                  }
              }, CurrentArtist)
              .ContinueWith(task =>
              {
                  if (task.Exception != null)
                  {
                      task.Exception.Handle(e =>
                      {
                          Logger.Log(e.ToString(), Category.Exception, Priority.Medium);
                          return true;
                      });
                  }
              });
        }