sources: add image_url?, page_url?, and profile_url? methods.
Add methods to Source::URL for determining whether a URL is an image URL, a page URL, or a profile URL. Also add more source URL tests and fix various URL parsing bugs.
This commit is contained in:
@@ -87,6 +87,10 @@ class Source::URL::Moebooru < Source::URL
|
||||
end
|
||||
end
|
||||
|
||||
def image_url?
|
||||
md5.present?
|
||||
end
|
||||
|
||||
def page_url
|
||||
if work_id.present?
|
||||
"https://#{domain}/post/show/#{work_id}"
|
||||
|
||||
Reference in New Issue
Block a user