diff options
author | Yorhel <git@yorhel.nl> | 2019-08-29 11:52:04 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-08-29 11:52:04 +0200 |
commit | e197164c2bd23696d3bb901af18b67ec6e29a24b (patch) | |
tree | a7d73fb7616cf56372c4e5abb2fe154ed291b01a /lib/VNDB/Handler/VNPage.pm | |
parent | c5a50d785b4efef9dd78530ea86ec93a27d92068 (diff) |
Handler::VNPage: Indicate patchines in affiliate links
Diffstat (limited to 'lib/VNDB/Handler/VNPage.pm')
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index 74651a4e..ff5ba6a1 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -754,8 +754,11 @@ sub _useroptions { sub _affiliate_links { my($self, $r) = @_; - # url => [$title, $url, $price] - my %links = map +($_->[1],$_), grep $_->[2], map @{$self->entryLinks(r => $_)}, @$r; + # url => [$title, $url, $price, $rel] + my %links; + for my $rel (@$r) { + $links{$_->[1]} = $_ for map [@$_, $rel], grep $_->[2], @{$self->entryLinks(r => $rel)}; + } return if !keys %links; use utf8; @@ -768,6 +771,7 @@ sub _affiliate_links { txt $l->[2]; b class => 'grayedout', " @ "; txt $l->[0]; + b class => 'grayedout', ' (patch)' if $l->[3]{patch}; end; br; } |