示例#1
0
        /// <summary>
        /// Get Track Artwork from Custom Track Artwork folder
        /// </summary>
        /// <param name="mvTrackObject"></param>
        /// <returns></returns>
        private bool getTrackArtFromCustomTrackArtFolder(DBTrackInfo mvTrackObject)
        {
            bool found = false;

            logger.Debug("In Method getTrackArtFromCustomTrackArtFolder(DBTrackInfo mv)");

            if (mvTrackObject == null)
            {
                return(false);
            }

            // grab a list of possible filenames for the artistart based on the user pattern
            string        pattern   = mvCentralCore.Settings.TrackArtworkFilenamePattern;
            List <string> filenames = getPossibleNamesFromPattern(pattern, mvTrackObject);

            // check the artistart folder for the user patterned artistarts
            string   trackartFolderPath = mvCentralCore.Settings.CustomTrackArtFolder;
            FileInfo newTrackArt        = getFirstFileFromFolder(trackartFolderPath, filenames);

            if (newTrackArt != null && newTrackArt.Exists)
            {
                mvTrackObject.ArtFullPath = newTrackArt.FullName;
                mvTrackObject.AlternateArts.Add(newTrackArt.FullName);
                mvTrackObject.GenerateThumbnail();
                logger.Info("Loaded trackimage from " + newTrackArt.FullName);
                return(true);
            }
            return(found);
        }
示例#2
0
        /// <summary>
        /// Get Track Artwork from Custom Track Artwork folder
        /// </summary>
        /// <param name="mvTrackObject"></param>
        /// <returns></returns>
        private bool getTrackArtFromCustomTrackArtFolder(DBTrackInfo mvTrackObject)
        {
            bool found = false;
              logger.Debug("In Method getTrackArtFromCustomTrackArtFolder(DBTrackInfo mv)");

              if (mvTrackObject == null)
            return false;

              // grab a list of possible filenames for the artistart based on the user pattern
              string pattern = mvCentralCore.Settings.TrackArtworkFilenamePattern;
              List<string> filenames = getPossibleNamesFromPattern(pattern, mvTrackObject);

              // check the artistart folder for the user patterned artistarts
              string trackartFolderPath = mvCentralCore.Settings.CustomTrackArtFolder;
              FileInfo newTrackArt = getFirstFileFromFolder(trackartFolderPath, filenames);
              if (newTrackArt != null && newTrackArt.Exists)
              {
            mvTrackObject.ArtFullPath = newTrackArt.FullName;
            mvTrackObject.AlternateArts.Add(newTrackArt.FullName);
            mvTrackObject.GenerateThumbnail();
            logger.Info("Loaded trackimage from " + newTrackArt.FullName);
            return true;
              }
              return found;
        }