]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Index.pm
Remove some really long-standing silliness: If we have no idea about width
[pr0n] / perl / Sesse / pr0n / Index.pm
index 8e740ce803b2819c1c5acac85d6ccd46471f12a3..74d5329d5cbc376207ae2e527b051c5202fa4f79 100644 (file)
@@ -199,13 +199,15 @@ sub handler {
 
                my @files = ();
                while (my $ref = $q->fetchrow_hashref()) {
-                       push @files, [ $ref->{'event'}, $ref->{'filename'} ];
+                       my $width = defined($ref->{'width'}) ? $ref->{'width'} : -1;
+                       my $height = defined($ref->{'height'}) ? $ref->{'height'} : -1;
+                       push @files, [ $ref->{'event'}, $ref->{'filename'}, $width, $height ];
                }
                
                for my $i (0..$#files) {
-                       $r->print("        [ \"" . $files[$i]->[0] . "\", \"" . $files[$i]->[1] . "\" ]");
-                       $r->print(",") unless ($i == $#files);
-                       $r->print("\n");
+                       my $line = sprintf "        [ \"%s\", \"%s\", %d, %d ]", @{$files[$i]};
+                       $line .= "," unless ($i == $#files);
+                       $r->print($line . "\n");
                }
 
                my %settings_no_fullscreen = %settings;
@@ -366,7 +368,7 @@ sub handler {
                                }
                        }
 
-                       if ($ref->{'width'} != -1 && $ref->{'height'} != -1) {
+                       if (defined($ref->{'width'}) && defined($ref->{'height'})) {
                                my $width = $ref->{'width'};
                                my $height = $ref->{'height'};
                                        
@@ -480,7 +482,7 @@ sub print_thumbsize {
 }
 sub print_viewres {
        my ($r, $event, $settings, $defsettings) = @_;
-       my @alternatives = qw(320x256 512x384 640x480 800x600 1024x768 1280x960);
+       my @alternatives = qw(320x256 512x384 640x480 800x600 1024x768 1280x960 1400x1050 1600x1200);
        chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'viewres-unlimited'));
        chomp (my $original = Sesse::pr0n::Templates::fetch_template($r, 'viewres-original'));
        push @alternatives, [ $unlimited, undef, undef ];