Exemple #1
0
        public IPath FindNearestPath(string path)
        {
            var publishCalculator = PublishInfos.Where(pi => Directory.Exists(pi.PathInfo.Fullname)).OrderBy(x => x.GetDifference(path)).FirstOrDefault(x => x.GetDifference(path) != null);

            LOGGER.Info($"Found nearest directory for path: '{path}': '{publishCalculator?.PathInfo.Fullname}'");

            return(publishCalculator?.PathInfo);
        }
Exemple #2
0
        public VideoInformation CreateVideo(string path, bool saveNextUploadSuggestion = true)
        {
            LOGGER.Info($"Creating video for path: '{path}' and save next upload suggestion: {saveNextUploadSuggestion}");

            // Template suchen anhand des Pfades
            var publishCalculator = PublishInfos.Where(pi => Directory.Exists(pi.PathInfo.Fullname)).OrderBy(x => x.GetDifference(path)).FirstOrDefault(x => x.GetDifference(path) != null);

            if (publishCalculator == null)
            {
                LOGGER.Warn($"Could not find fitting publish calculator - using a new one with empty fields");

                publishCalculator = new PublishTimeCalculator(new Paths.Path(), new Template());
            }

            return(CreateVideo(path, publishCalculator, saveNextUploadSuggestion));
        }