From 9abd8f0cc85b2a1770b46b00d87032749ffd9b50 Mon Sep 17 00:00:00 2001 From: lordwelch Date: Thu, 13 Feb 2020 00:27:08 -0800 Subject: [PATCH] Improve searchForSeries Refactor removearticles to only remove articles Add normalization on the search string and the series name results Searching now only compares ASCII a-z and 0-9 and all other characters are replaced with single space, this is done to both the search string and the result. This fixes an with names that are separated by a hyphen (-) in the filename but in the Comic Vine name are separated by a slash (/) and other similar issues. --- comicapi/utils.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/comicapi/utils.py b/comicapi/utils.py index aeec166..f82f99a 100644 --- a/comicapi/utils.py +++ b/comicapi/utils.py @@ -148,16 +148,6 @@ def removearticles(text): newText = newText[:-1] - # now get rid of some other junk - newText = newText.replace(":", "") - newText = newText.replace(",", "") - newText = newText.replace("-", " ") - - # since the CV API changed, searches for series names with periods - # now explicitly require the period to be in the search key, - # so the line below is removed (for now) - #newText = newText.replace(".", "") - return newText