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); }
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)); }