Beispiel #1
0
        /// <summary>
        /// Load online information for a specific artist.
        /// </summary>
        /// <param name="artist"></param>
        /// <returns></returns>
        public static async Task <DbArtist> LoadOnlineArtistInfoAsync(this DbArtist artist)
        {
            if (artist == null)
            {
                throw new ArgumentNullException(nameof(artist));
            }

            if (InternetConnectivityDetector.HasInternetConnection)
            {
                try
                {
                    if (string.IsNullOrEmpty(artist.Intro))
                    {
                        artist = await artist.LoadArtistIntroAsync();
                    }

                    return(artist);
                }
                catch (Exception ex)
                {
                    TelemetryHelper.TrackExceptionAsync(ex);
                    return(artist);
                }
            }

            return(artist);
        }