summaryrefslogtreecommitdiff
path: root/awk
diff options
context:
space:
mode:
Diffstat (limited to 'awk')
-rw-r--r--awk/stats_reviews.awk3
-rw-r--r--awk/utils.awk2
2 files changed, 3 insertions, 2 deletions
diff --git a/awk/stats_reviews.awk b/awk/stats_reviews.awk
index eb5605a..9716608 100644
--- a/awk/stats_reviews.awk
+++ b/awk/stats_reviews.awk
@@ -3,6 +3,7 @@ BEGIN {
t_day = time_days_ago(1);
t_week = time_days_ago(7);
t_month = time_days_ago(30);
+ min_box = or_default(min_box, 0);
}
{
@@ -15,7 +16,7 @@ BEGIN {
interval = $7;
rating = $8;
- if (box >= 2) {
+ if (box >= min_box) {
if (date > t_day) {
ratings_day[rating]++;
n_day++;
diff --git a/awk/utils.awk b/awk/utils.awk
index 159f9b7..01295a2 100644
--- a/awk/utils.awk
+++ b/awk/utils.awk
@@ -19,5 +19,5 @@ function time_days_ago(n) {
}
function or_default(var, def) {
- return var ? var : def;
+ return (var != "") ? var : def;
}