Source::URL: add profile_url method.
Add a method for converting a source URL into a profile URL. This will be used for normalizing profile URLs in artist entries. Also add the ability to parse a few more profile URL formats.
This commit is contained in:
@@ -70,4 +70,12 @@ class Source::URL::Mastodon < Source::URL
|
||||
def image_url?
|
||||
full_image_url.present?
|
||||
end
|
||||
|
||||
def profile_url
|
||||
if username.present?
|
||||
"https://#{host}/@#{username}"
|
||||
elsif user_id.present?
|
||||
"https://#{host}/web/accounts/#{user_id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user