private void RemoveVersion(Item item) { var itemSig = $"{item.Database}:{item.ID}/{item.Language}#{item.Version}"; if (ProcessedList.Contains(itemSig)) { return; } ProcessedList.Add(itemSig); if (!ShouldProcess(item.GetProviderPath() + ", Lang:" + item.Language.Name + ", Ver:" + item.Version.Number, confirmMessage)) { return; } var hasArchive = IsParameterSpecified(nameof(Archive)); var hasPermanently = IsParameterSpecified(nameof(Permanently)); if (hasArchive && hasPermanently) { WriteError(typeof(ParameterBindingException), "Parameter set cannot be resolved using the specified named parameters. Detected Archive and Permanently parameters provided.", ErrorIds.AmbiguousParameterSet, ErrorCategory.InvalidOperation, null); return; } if (IsParameterSpecified("Archive")) { var archive = ArchiveManager.GetArchive("archive", item.Database); if (archive == null) { return; } WriteVerbose($"Removing item {itemSig} and moving to the archive {archive.Name} in database {item.Database}"); archive.ArchiveVersion(item); } else if (IsParameterSpecified("Permanently")) { WriteVerbose($"Removing item {itemSig} permanently."); item.Versions.RemoveVersion(); } else { var archive = ArchiveManager.GetArchive("recyclebin", item.Database); if (archive == null) { return; } WriteVerbose($"Removing item {itemSig} and moving to the archive {archive.Name} in database {item.Database}"); archive.ArchiveVersion(item); } }
private void RemoveVersion(Item item) { var itemSig = $"{item.Database}:{item.ID}/{item.Language}#{item.Version}"; if (!ProcessedList.Contains(itemSig)) { ProcessedList.Add(itemSig); if ( ShouldProcess( item.GetProviderPath() + ", Lang:" + item.Language.Name + ", Ver:" + item.Version.Number, confirmMessage)) { item.Versions.RemoveVersion(); } } }
public void ProcessLinks(IEnumerable <string> links) { foreach (var link in links.Where(l => !string.IsNullOrEmpty(l)).Distinct()) { var clearedLink = ClearLink(link); if (!_robots.IsPathAllowed(Crawler.USER_AGENT, clearedLink)) { continue; } if (UrlHelper.GetDomain(UrlHelper.CreatUri(clearedLink)) == _masterDomain && !ProcessedList.Contains(clearedLink) && !ToProcessList.Contains(clearedLink)) { ToProcessList.Push(clearedLink); } } }