sources: remove image_url method from base strategy.

Remove the `image_url` method from source strategies. This method would
return only the first image if a source had multiple images. The
`image_urls` method should be used instead. Tests were the main place
that still used `image_url` instead of `image_urls`.

Also make post replacements return an error if replacing with a source
that contains multiple images, instead of just blindly replacing the
post with the first image in the source.
This commit is contained in:
evazion
2022-03-11 01:55:29 -06:00
parent 4701027f45
commit 2f61486ac6
29 changed files with 164 additions and 159 deletions

View File

@@ -62,7 +62,7 @@ module Sources
end
def canonical_url
image_url
image_urls.first
end
def profile_url
@@ -122,7 +122,7 @@ module Sources
tag.gsub(/\d+users入り\z/i, "")
end
def download_file!(url = image_url)
def download_file!(url)
file = super(url)
file.frame_data = ugoira_frame_data if is_ugoira?
file