aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Rss.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 7cf4783c0..e1da4445d 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -282,14 +282,15 @@ sub add_row : Private {
$item{pubDate} = $pubDate if $pubDate;
$item{category} = encode_entities($row->{category}) if $row->{category};
- if ($c->cobrand->allow_photo_display($row) && $row->{photo}) {
+ if ((my $photo_to_show = $c->cobrand->allow_photo_display($row)) && $row->{photo}) {
# Bit yucky as we don't have full objects here
my $photoset = FixMyStreet::App::Model::PhotoSet->new({ db_data => $row->{photo} });
- my $first_fn = $photoset->get_id(0);
+ my $idx = $photo_to_show - 1;
+ my $first_fn = $photoset->get_id($idx);
my ($hash, $format) = split /\./, $first_fn;
my $cachebust = substr($hash, 0, 8);
my $key = $alert_type->item_table eq 'comment' ? 'c/' : '';
- $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.0.$format?$cachebust\">");
+ $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.$idx.$format?$cachebust\">");
}
if ( $row->{used_map} ) {