Esempio n. 1
0
        private void setMusicVideoArtist(ref DBArtistInfo mv, string artistName, string artistmbid)
        {
            if (string.IsNullOrEmpty(artistName))
            {
                return;
            }
            logger.Debug("In Method: setMusicVideoArtist(ref DBArtistInfo mv, Artist: " + artistName + " MBID: " + artistmbid + ")");

            MusicDatabase m_db = null;

            try
            {
                m_db = MusicDatabase.Instance;
            }
            catch (Exception e)
            {
                logger.Error("setMusicVideoArtist: Music database init failed " + e.ToString());
                return;
            }

            var artistInfo = new MediaPortal.Music.Database.ArtistInfo();

            if (!m_db.GetArtistInfo(artistName, ref artistInfo))
            {
                return;
            }

            // Name
            mv.Artist = artistName;
            // MBID
            // mv.MdID =
            // Tags
            char[]   delimiters = new char[] { ',' };
            string[] tags       = artistInfo.Genres.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            foreach (string tag in tags)
            {
                mv.Tag.Add(tag.Trim());
            }
            tags = artistInfo.Styles.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            foreach (string tag in tags)
            {
                mv.Tag.Add(tag.Trim());
            }
            // Bio
            mv.bioSummary = artistInfo.AMGBio;
            mv.bioContent = artistInfo.AMGBio;
            // Additional
            mv.Born        = artistInfo.Born;
            mv.Genre       = artistInfo.Genres;
            mv.Styles      = artistInfo.Styles;
            mv.YearsActive = artistInfo.YearsActive;
            // Image URL
            if (!string.IsNullOrEmpty(artistInfo.Image) && !mv.ArtUrls.Contains(artistInfo.Image))
            {
                mv.ArtUrls.Add(artistInfo.Image);
            }
        }