X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FIndex.pm;h=a00cadf8e23dba933ab70d1869f2ee81a2350353;hp=f8f44048ff385a6bdfaa3ed5f506b84fcd8d0f7f;hb=312aab3d35a5472261ade2926fa7fb75a303e798;hpb=a5c13b107460a55b50424d6c6bd6a77abf71300d diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index f8f4404..a00cadf 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -155,14 +155,16 @@ sub handler { # Find the equipment used my $eq = $dbh->prepare(' - SELECT DISTINCT - model.value AS model, - coalesce(lens_spec.value, lens.value) AS lens + SELECT + TRIM(model.value) AS model, + coalesce(TRIM(lens_spec.value), TRIM(lens.value)) AS lens, + COUNT(*) AS num FROM images i LEFT JOIN exif_info model ON i.id=model.image LEFT JOIN ( SELECT * FROM exif_info WHERE tag=\'Lens\' ) lens ON i.id=lens.image LEFT JOIN ( SELECT * FROM exif_info WHERE tag=\'LensSpec\') lens_spec ON i.id=lens_spec.image WHERE event=? AND model.tag=\'Model\' + GROUP BY 1,2 ORDER BY 1,2') or die "Couldn't prepare to find equipment: $!"; $eq->execute($event) @@ -175,8 +177,9 @@ sub handler { # # Some compact cameras seem to add lens info sometimes and not at other # times; if we have seen a camera with at least one specific lens earlier, - # just ignore entries without a lens. + # just combine entries without a lens with the previous one. # + $equipment[$#equipment]->{'num'} += $ref->{'num'}; next; } push @equipment, $ref; @@ -187,11 +190,14 @@ sub handler { if (scalar @equipment > 0) { Sesse::pr0n::Templates::print_template($r, "equipment-start"); for my $e (@equipment) { - $r->print("
\n"); } if ($ref->{'width'} != -1 && $ref->{'height'} != -1) { @@ -315,6 +329,8 @@ sub handler { } $r->print(" \n"); + + ++$img_num; } $r->print("
\n"); } @@ -562,6 +578,20 @@ sub print_fullscreen { Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings); $r->print("\n"); } + +sub print_fullscreen_fromhere { + my ($r, $event, $settings, $defsettings, $start) = @_; + + chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen-fromhere')); + + my %newsettings = %$settings; + $newsettings{'fullscreen'} = 1; + $newsettings{'start'} = $start; + + $r->print(""); + Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings); + $r->print("
\n"); +} 1;