private void ExecuteQueueTopTrack(HotArtistModel artist)
 {
     GetTopTrackForArtistAsync(artist)
         .ContinueWith(task =>
         {
             if (task.Result != null)
             {
                 _radio.Queue(task.Result.ToTrackStream(task.Result.Name, "Top hot artists"));
                 _toastService.Show(new ToastData
                 {
                     Message = "Queued " + task.Result.Name,
                     Icon = AppIcons.Add
                 });
             }
             else
             {
                 _toastService.Show("Unable to find track " + artist.HotSongTitle);
             }
         });
 }
        private Task<Track> GetTopTrackForArtistAsync(HotArtistModel artist)
        {
            return Task.Factory
                .StartNew(state =>
                {
                    HotArtistModel m = (HotArtistModel)state;
                    using (_loadingIndicator.EnterLoadingBlock())
                    {
                        var result = _radio.GetTracksByName(m.Name + " " + m.HotSongTitle);
                        var track = result.FirstOrDefault(
                            t => t.Artist.Equals(m.Name, StringComparison.InvariantCultureIgnoreCase));

                        if (track == null)
                        {
                            track = result.FirstOrDefault();
                        }

                        return track;
                    }
                }, artist)
                .ContinueWith(task =>
                {
                    if (task.Exception != null)
                    {
                        _logger.Log(task.Exception.ToString(), Category.Exception, Priority.Medium);
                        _toastService.Show("Unable to play track");
                    }

                    return task.Result;
                });
        }
 private void ExecutePlayTopTrack(HotArtistModel artist)
 {
     GetTopTrackForArtistAsync(artist)
         .ContinueWith(task =>
         {
             if (task.Result != null)
             {
                 _radio.Play(task.Result.ToTrackStream(task.Result.Name, "Top hot artists"));
             }
             else
             {
                 _toastService.Show("Unable to find track " + artist.HotSongTitle);
             }
         });
 }