Пример #1
0
        /// <summary>
        /// Get the Artist Artwork from Mediaportal folder
        /// </summary>
        /// <param name="mvArtistObject"></param>
        /// <returns></returns>
        private bool getMPArtistArt(DBArtistInfo mvArtistObject)
        {
            logger.Debug("In Method: getMPArtistArt(DBArtistInfo mvArtistObject)");
            bool found = false;

            string thumbFolder = Thumbs.MusicArtists;
            string cleanTitle  = MediaPortal.Util.Utils.MakeFileName(mvArtistObject.Artist);
            string filename    = thumbFolder + @"\" + cleanTitle + "L.jpg";

            if (File.Exists(filename))
            {
                found &= mvArtistObject.AddArtFromFile(filename);
            }
            logger.Debug("In Method: getMPArtistArt(DBArtistInfo mvArtistObject) filename: " + filename + " - " + found);
            return(found);
        }
Пример #2
0
        /// <summary>
        /// Get the Artist Artwork using the old Method
        /// </summary>
        /// <param name="mvArtistObject"></param>
        /// <returns></returns>
        private bool getOldArtistArt(DBArtistInfo mvArtistObject)
        {
            logger.Debug("In Method getOldArtistArt(DBArtistInfo mv)");
            bool found = false;

            string        artistartFolderPath = mvCentralCore.Settings.ArtistArtFolder;
            DirectoryInfo artistartFolder     = new DirectoryInfo(artistartFolderPath);

            string safeName          = mvArtistObject.Artist.Replace(' ', '.').ToValidFilename();
            Regex  oldArtistArtRegex = new Regex("^{?" + Regex.Escape(safeName) + "}? \\[-?\\d+\\]\\.(jpg|png)");

            foreach (FileInfo currFile in artistartFolder.GetFiles())
            {
                if (oldArtistArtRegex.IsMatch(currFile.Name))
                {
                    found &= mvArtistObject.AddArtFromFile(currFile.FullName);
                }
            }
            return(found);
        }