Skip to content

Commit

Permalink
Fix #5727: Fandom: p__/protagonist.
Browse files Browse the repository at this point in the history
  • Loading branch information
evazion committed May 22, 2024
1 parent b10b21c commit 6f12531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions app/logical/source/url/fandom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/unit/sources/fandom_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f12531

Please sign in to comment.