Disable images' counter option

This commit is contained in:
Luc Didry
2018-04-07 11:52:51 +02:00
parent f26e7ba5ff
commit 163a1e2a66
6 changed files with 39 additions and 27 deletions
+1
View File
@@ -55,6 +55,7 @@ sub startup {
},
cache_max_size => 0,
quiet_logs => 0,
disable_img_stats => 0,
}
});
+12 -8
View File
@@ -629,10 +629,12 @@ sub short {
$c->app->log->info('[VIEW] someone viewed '.$image->filename.' (path: '.$image->path.')') unless $c->config('quiet_logs');
# Update record
if ($c->config('minion')->{enabled}) {
$c->app->minion->enqueue(accessed => [$image->short, time]);
} else {
$image->accessed(time);
unless ($c->config('disable_img_stats')) {
if ($c->config('minion')->{enabled}) {
$c->app->minion->enqueue(accessed => [$image->short, time]);
} else {
$image->accessed(time);
}
}
# Delete image if needed
@@ -731,10 +733,12 @@ sub zip {
$c->app->log->info('[VIEW] someone viewed '.$image->filename.' (path: '.$image->path.')') unless $c->config('quiet_logs');
# Update counter and record
if ($c->config('minion')->{enabled}) {
$c->app->minion->enqueue(accessed => [$image->short, time]);
} else {
$image->accessed(time);
unless ($c->config('disable_img_stats')) {
if ($c->config('minion')->{enabled}) {
$c->app->minion->enqueue(accessed => [$image->short, time]);
} else {
$image->accessed(time);
}
}
}
} elsif ($image->path && !$image->enabled) {
+1
View File
@@ -48,6 +48,7 @@ sub startup {
},
cache_max_size => 0,
quiet_logs => 0,
disable_img_stats => 0,
}
}
);