예제 #1
0
        /// <summary>
        /// Gets the MediaInfo for the given videopath
        /// </summary>
        /// <param name="self"></param>
        /// <param name="videoPath">path to the video</param>
        /// <returns>MediaInfoWrapper object for this video</returns>
        public static MediaInfoWrapper GetMediaInfo(this VideoFormat self, string videoPath)
        {
            string mainFeatureFile;

            if (self == VideoFormat.DVD)
            {
                // because dvds have multiple files
                // we must build a list of all IFO files, and loop through them.
                // the best file wins
                List <string> files = new List <string>();
                files.AddRange(Directory.GetFiles(Path.GetDirectoryName(videoPath), "*.ifo"));
                mainFeatureFile = VideoUtility.FindFeatureFilm(files);
            }
            else
            {
                mainFeatureFile = self.GetMainFeatureFilePath(videoPath);
            }

            if (videoPath != mainFeatureFile)
            {
                logger.Debug("Format={0}, FeatureFilmFile='{1}'", self, mainFeatureFile);
            }

            return(new MediaInfoWrapper(mainFeatureFile));
        }
예제 #2
0
        public static string GetMountedVideoDiscPath(string imagePath)
        {
            if (!IsMounted(imagePath))
            {
                return(null);
            }

            string drive = DaemonTools.GetVirtualDrive();

            return(VideoUtility.GetVideoPath(drive));
        }
예제 #3
0
 /// <summary>
 /// Checks if a folder contains a maximum amount of video files
 /// This is used to determine if a folder is dedicated to one movie
 /// </summary>
 /// <param name="folder">the directory to check</param>
 /// <param name="expectedCount">maximum count</param>
 /// <returns>True if folder is dedicated</returns>
 public static bool isFolderDedicated(DirectoryInfo folder, int expectedCount)
 {
     return(VideoUtility.GetVideoFileCount(folder) <= expectedCount);
 }