diff --git a/phosta.pl b/phosta.pl
index ec4b080323e925f7ee92e6ab2f99fcfbf6223660..580be2479b87a57675b1d79a3b4ec285df55bcbf 100755
--- a/phosta.pl
+++ b/phosta.pl
@@ -3,6 +3,7 @@ # Copyright(c) René Wagner 2019-2020
+use v5.32;
use warnings;
use strict;
use feature qw(say);
@@ -12,7 +13,6 @@ use Cwd;
use DBI;
use File::Basename;
use File::Spec::Functions;
-use File::HomeDir;
use Getopt::Std;
my $driver = "SQLite";
@@ -23,38 +23,38 @@ my $password = "";
$Getopt::Std::STANDARD_HELP_VERSION = 'true';
-my $VERSION = '0.2';
+my $VERSION = '0.3';
my $PROGRAM = 'Photo Stats';
-my $configfile = catfile(File::HomeDir->my_home, '.photo-stats.conf');
our $opt_p='';
our $opt_c=0;
-getconfig($configfile);
+our $opt_q=0;
+our $opt_s='';
+our $opt_g='';
-getopts('cp:') or die "Invalid parameters provided! See 'phosta.pl --help' for more details.";
-#if ( $opt_s ) { writeconfig($configfile); }
+getopts('cqp:g:s:') or die "Invalid parameters provided! See 'phosta.pl --help' for more details.";
if ( $opt_p ne '' ) {
+}
+if ( $opt_q ) {
}
exit 0;
-sub get_stats
+sub populate_db
{
my $cmd = "exiftool -fast2 -r -m -f -p '\$filepath##\$make##\$model##\$lens##\$lensmodel##\$focallength##\$focallengthin35mmformat##\$aperture##\$exposuretime##\$iso##\$flash##\$datetimeoriginal' -d \"%Y-%m-%d %H:%M:%S\" -ext jpg " . $destination_dir;
my @lines = qx($cmd);
my $errorcount = 0;
my $emptycount = 0;
foreach (@lines)
@@ -77,18 +77,56 @@ say sprintf('%5d', $emptycount). ' image files skipped due to missing EXIF data';
say sprintf('%5d', $errorcount). ' image files skipped due to errors';
}
-sub getconfig
+sub get_sql
{
when ('week')
{
$grouping_field = "strftime('%Y/%m', datetimeoriginal) as month,";
$grouping_group = "GROUP BY strftime('%Y/%m', datetimeoriginal)";
}
when ('month')
{
$grouping_field = "strftime('%Y/%W', datetimeoriginal) as week_of_year,";
$grouping_group = "GROUP BY strftime('%Y/%W', datetimeoriginal)";
}
when ('year')
{
$grouping_field = "strftime('%Y', datetimeoriginal) as year,";
$grouping_group = "GROUP BY strftime('%Y', datetimeoriginal)";
}
default
{
}
}
-sub writeconfig
+sub query_db
{
print join(", ", @row), "\n";
}
sub main::VERSION_MESSAGE()
@@ -109,5 +147,7 @@ say '';
say 'options:';
say ' -p <folder> : populate database from the files in the specified folder';
say ' -c : clear the database before populating with data from the folder';
}
text/gemini
This content has been proxied by September (ba2dc).