diff --git a/phosta.pl b/phosta.pl
index 580be2479b87a57675b1d79a3b4ec285df55bcbf..37b8f974243209aa34b2c4927909236a9e47c599 100755
--- a/phosta.pl
+++ b/phosta.pl
@@ -5,6 +5,7 @@ # published under BSD 3-Clause License - https://git.sr.ht/~rwa/photo-stats/tree/master/LICENSE
use v5.32;
use warnings;
+no warnings 'experimental';
use strict;
use feature qw(say);
use POSIX qw(lround);
@@ -81,31 +82,36 @@ sub get_sql
{
my ($selected, $grouping) = @_;
given ($grouping)
{
when ('week')
{
$grouping_field = "strftime('%Y/%m', datetimeoriginal) as month,";
$grouping_group = "GROUP BY strftime('%Y/%m', datetimeoriginal)";
$fieldlist = "strftime('%Y/%m', datetimeoriginal) as month,";
$grouplist = "strftime('%Y/%m', datetimeoriginal)";
}
when ('month')
{
$grouping_field = "strftime('%Y/%W', datetimeoriginal) as week_of_year,";
$grouping_group = "GROUP BY strftime('%Y/%W', datetimeoriginal)";
$fieldlist = "strftime('%Y/%W', datetimeoriginal) as week_of_year,";
$grouplist = "strftime('%Y/%W', datetimeoriginal)";
}
when ('year')
{
$grouping_field = "strftime('%Y', datetimeoriginal) as year,";
$grouping_group = "GROUP BY strftime('%Y', datetimeoriginal)";
}
default
{
$fieldlist = "strftime('%Y', datetimeoriginal) as year,";
$grouplist = "strftime('%Y', datetimeoriginal)";
}
}
$fieldlist = $fieldlist . $selected . ', ';
$grouplist = $grouplist . ','. $selected;
}
sub query_db
@@ -117,7 +123,8 @@
my $total_count = $dbh->selectrow_array("SELECT count(file) from photos");
say "Querying local database with $total_count entries...";
say '';
my $stmt = $dbh->prepare(get_sql($selected, $grouping));
my @row;
$stmt->execute();
text/gemini
This content has been proxied by September (ba2dc).