Refactor source normalization
* Move the source normalization logic out of the post model and into individual sources' strategies. * Rewrite normalization tests to be handled into each source's test, and expand them significantly. Previously we were only testing a very small subset of domains and variants. * Fix up normalization for several sites. * Normalize fav.me urls into normal deviantart urls.
This commit is contained in:
@@ -24,5 +24,9 @@ module Sources
|
||||
def self.canonical(url, referer)
|
||||
find(url, referer).canonical_url
|
||||
end
|
||||
|
||||
def self.normalize_source(url)
|
||||
find(url).normalize_for_source || url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user