sources: fix sources sometimes choosing wrong strategy (fix #3968)
Fix sources choosing the wrong strategy when the referer belongs to a different site (for example, when uploading a twitter post with a pixiv referer). * Fix `match?` to only consider the main url, not the referer. * Change `match?` to match against a list of domains given by the `domains` method. * Change `match?` to an instance method.
This commit is contained in:
@@ -38,8 +38,8 @@ module Sources
|
||||
|
||||
delegate :artist_name, :profile_url, :unique_id, :artist_commentary_title, :artist_commentary_desc, :dtext_artist_commentary_title, :dtext_artist_commentary_desc, to: :sub_strategy, allow_nil: true
|
||||
|
||||
def self.match?(*urls)
|
||||
urls.compact.any? { |x| x.match?(BASE_URL) }
|
||||
def domains
|
||||
["yande.re", "konachan.com"]
|
||||
end
|
||||
|
||||
def site_name
|
||||
|
||||
Reference in New Issue
Block a user