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:
@@ -213,6 +213,12 @@ module Sources
|
||||
illust_id.present? || novel_id.present? || fanbox_id.present? || fanbox_account_id.present?
|
||||
end
|
||||
|
||||
def normalize_for_source
|
||||
return if illust_id.blank?
|
||||
|
||||
"https://www.pixiv.net/artworks/#{illust_id}"
|
||||
end
|
||||
|
||||
def tag_name
|
||||
moniker
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user