From 4f9430e32d335d5f2e45806c1eafa3eb1adc16b0 Mon Sep 17 00:00:00 2001 From: boranblok Date: Tue, 27 Oct 2015 20:50:00 +0100 Subject: [PATCH] Fix for a bug on the indexer that double escapes ampersands in the search rss. --- nntpAutoposter/IndexerVerifier.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nntpAutoposter/IndexerVerifier.cs b/nntpAutoposter/IndexerVerifier.cs index 37aaff6..bb561b3 100644 --- a/nntpAutoposter/IndexerVerifier.cs +++ b/nntpAutoposter/IndexerVerifier.cs @@ -156,12 +156,12 @@ private Boolean UploadIsOnIndexer(UploadEntry upload) foreach (var item in feed.Items) { Decimal similarityPercentage = - LevenshteinDistance.SimilarityPercentage(item.Title.Text, upload.CleanedName); + LevenshteinDistance.SimilarityPercentage(CleanGeekBug(item.Title.Text), upload.CleanedName); if (similarityPercentage > configuration.VerifySimilarityPercentageTreshold) return true; Decimal similarityPercentageWithIndexCleanedName = - LevenshteinDistance.SimilarityPercentage(item.Title.Text, searchName); + LevenshteinDistance.SimilarityPercentage(CleanGeekBug(item.Title.Text), searchName); if (similarityPercentageWithIndexCleanedName > configuration.VerifySimilarityPercentageTreshold) return true; } @@ -170,6 +170,12 @@ private Boolean UploadIsOnIndexer(UploadEntry upload) return false; } + //HACK: nzbgeek does a double escape of ampersands in the returned RSS feed. I dont think this is intended. + private string CleanGeekBug(String title) + { + return title.Replace("&", "&"); + } + private String GetIndexerSearchName(String cleanedName) { StringBuilder sb = new StringBuilder(cleanedName);