/// <summary>
        /// Scrobbles the selected tracks.
        /// </summary>
        /// <returns>Task.</returns>
        public override async Task Scrobble()
        {
            try
            {
                EnableControls = false;
                OnStatusUpdated("Trying to scrobble cached tracks...");
                var response = await Scrobbler.SendCachedScrobblesAsync();

                if (response.Success && response.Status == LastResponseStatus.Successful)
                {
                    OnStatusUpdated("Successfully scrobbled cached tracks");
                }
                else
                {
                    OnStatusUpdated(string.Format("Error scrobbling cached tracks: {0}", response.Status));
                }
            }
            catch (Exception ex)
            {
                OnStatusUpdated(string.Format("Fatal error while trying to scrobble cached tracks: {0}", ex.Message));
            }
            finally
            {
                await GetCachedScrobbles();

                EnableControls = true;
            }
        }
Exemplo n.º 2
0
 public Task <ScrobbleResponse> SendCachedScrobblesAsync()
 {
     return(_scrobbler.SendCachedScrobblesAsync());
 }