diff --git a/app/logical/source/url/fandom.rb b/app/logical/source/url/fandom.rb index a3771852c..ce7fd491a 100644 --- a/app/logical/source/url/fandom.rb +++ b/app/logical/source/url/fandom.rb @@ -35,6 +35,7 @@ class Source::URL::Fandom < Source::URL [nil, "masterofeternity_gamepedia_en"] => "masterofeternity", [nil, "ninehourspersonsdoors"] => "zeroescape", [nil, "onigiri-en"] => "onigiri", + ["protagonist", "p__"] => "hero", [nil, "ritualofthenight"] => "bloodstained", [nil, "rockman_x_dive"] => "rockman-x-dive", [nil, "romancingsaga"] => "saga", @@ -53,12 +54,6 @@ class Source::URL::Fandom < Source::URL [nil, "yorukuni"] => "nightsofazure", [nil, "youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e"] => "you-zitsu", [nil, "zoe"] => "zoneoftheenders", - - # XXX Different images; not the same wiki? - # https://static.wikia.nocookie.net/p__/protagonist/images/3/3f/Yukiko_Amagi_(BlazBlue_Cross_Tag_Battle%2C_Character_Select_Artwork).png - # https://static.wikia.nocookie.net/megamitensei/images/3/3f/Yukiko_Amagi_(BlazBlue_Cross_Tag_Battle%2C_Character_Select_Artwork).png - # https://megamitensei.fandom.com/wiki/Gallery?file=Yukiko_Amagi_%28BlazBlue_Cross_Tag_Battle%2C_Character_Select_Artwork%29.png - # [nil, "p__"] => "megamitensei", }.with_indifferent_access attr_reader :wiki_db_name, :file, :path_prefix, :image_uuid, :full_image_path, :page diff --git a/test/unit/sources/fandom_test.rb b/test/unit/sources/fandom_test.rb index ecdac1ee4..96c9ed265 100644 --- a/test/unit/sources/fandom_test.rb +++ b/test/unit/sources/fandom_test.rb @@ -131,6 +131,7 @@ class FandomTest < ActiveSupport::TestCase assert_equal("https://typemoon.fandom.com/fr/wiki/Gallery?file=Aozaki_Aoko_Blue.png", Source::URL.page_url("http://img3.wikia.nocookie.net/__cb20140404214519/typemoon/images/f/fd/Aozaki_Aoko_Blue.png/revision/latest?path-prefix=fr")) assert_equal("https://typemoon.fandom.com/fr/wiki/Gallery?file=Aozaki_Aoko_Blue.png", Source::URL.page_url("http://img3.wikia.nocookie.net/__cb20140404214519/typemoon/fr/images/thumb/f/fd/Aozaki_Aoko_Blue.png/500px-Aozaki_Aoko_Blue.png")) assert_equal("https://allanimefanon.fandom.com/wiki/Gallery?file=2560-1600-104761.jpg", Source::URL.page_url("http://img3.wikia.nocookie.net/__cb20130520180921/allanimefanon/images/thumb/8/82/2560-1600-104761.jpg/2000px-2560-1600-104761.jpg")) + assert_equal("https://hero.fandom.com/protagonist/wiki/Gallery?file=Yukiko_Amagi_(BlazBlue_Cross_Tag_Battle,_Character_Select_Artwork).png", Source::URL.page_url("https://static.wikia.nocookie.net/p__/protagonist/images/3/3f/Yukiko_Amagi_(BlazBlue_Cross_Tag_Battle%2C_Character_Select_Artwork).png")) end should "parse URLs correctly" do