Skip to content

Commit

Permalink
Fix for a bug on the indexer that double escapes ampersands in the se…
Browse files Browse the repository at this point in the history
…arch rss.
  • Loading branch information
boranblok committed Oct 27, 2015
1 parent 3daecbc commit 4f9430e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nntpAutoposter/IndexerVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 4f9430e

Please sign in to comment.