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:
@@ -131,7 +131,7 @@ module Downloads
|
||||
context "An ugoira site for pixiv" do
|
||||
should "capture the data" do
|
||||
@strategy = Sources::Strategies.find("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364")
|
||||
media_file = @strategy.download_file!
|
||||
media_file = @strategy.download_file!(@strategy.image_urls.sole)
|
||||
|
||||
assert_equal(2, media_file.frame_data.size)
|
||||
assert_equal([{"file" => "000000.jpg", "delay" => 125}, {"file" => "000001.jpg", "delay" => 125}], media_file.frame_data)
|
||||
|
||||
Reference in New Issue
Block a user