Example #1
0
        /// <summary>
        /// get the artist details and update missing data from this source
        /// </summary>
        /// <param name="mv"></param>
        /// <returns></returns>
        public DBTrackInfo GetArtistDetail(DBTrackInfo mv)
        {
            string strArtistHtml;
            string strArtistUrl;

            // Get details of the artist
            string artist = mv.ArtistInfo[0].Artist;

            if (GetArtistHTML(artist, out strArtistHtml, out strArtistUrl))
            {
                var artistInfo = AMGHTMLParser.ParseArtistHTML(strArtistHtml, artist);
                //var artistInfo = new MusicArtistInfo();
                if (artistInfo != null)
                {
                    artistInfo.Artist = artist;
                    DBArtistInfo mv1 = (DBArtistInfo)mv.ArtistInfo[0];
                    UpdateMusicVideoArtist(ref mv1, artistInfo, strArtistHtml);
                }
            }

            return(mv);
        }
Example #2
0
        /// <summary>
        /// Get the Artist, Album Details
        /// </summary>
        /// <param name="mv"></param>
        /// <returns></returns>
        public bool GetDetails(DBBasicInfo mv)
        {
            string strArtistHTML;
            string strAlbumHTML;
            string strArtistURL;

            ReportProgress(string.Empty);

            // Get details of the artist
            if (mv.GetType() == typeof(DBArtistInfo))
            {
                string artist = ((DBArtistInfo)mv).Artist;
                ReportProgress("Getting Artist...");
                if (GetArtistHTML(artist, out strArtistHTML, out strArtistURL))
                {
                    var artistInfo = AMGHTMLParser.ParseArtistHTML(strArtistHTML, artist);

                    if (artistInfo != null)
                    {
                        artistInfo.Artist = artist;
                        DBArtistInfo mv1 = (DBArtistInfo)mv;
                        SetMusicVideoArtist(ref mv1, artistInfo, strArtistHTML);
                        GetArtistArt((DBArtistInfo)mv);
                        ReportProgress("Done...");
                        return(true);
                    }
                }
                return(false);
            }
            // get details of the album
            if (mv.GetType() == typeof(DBAlbumInfo))
            {
                string             album     = ((DBAlbumInfo)mv).Album;
                List <DBTrackInfo> trackList = DBTrackInfo.GetEntriesByAlbum((DBAlbumInfo)mv);
                DBArtistInfo       artist    = DBArtistInfo.Get(trackList[0]);

                if (GetAlbumHTML(artist.Artist, album, out strAlbumHTML))
                {
                    var albumInfo = AMGHTMLParser.ParseAlbumHTML(strAlbumHTML, album, artist.Artist);
                    if (albumInfo != null)
                    {
                        albumInfo.Artist = album;
                        DBAlbumInfo mv1 = (DBAlbumInfo)mv;
                        SetMusicVideoAlbum(ref mv1, albumInfo);
                    }
                }
                return(false);
            }

            // get details of the track
            if (mv.GetType() == typeof(DBTrackInfo))
            {
                if (((DBTrackInfo)mv).LocalMedia[0].IsDVD)
                {
                    string track = ((DBTrackInfo)mv).Track;
                    GetDVDDetails((DBTrackInfo)mv);
                    return(true);
                }
                else
                {
                    string track = ((DBTrackInfo)mv).Track;
                    GetTrackDetails((DBTrackInfo)mv);
                    return(true);
                }
            }

            return(true);
        }