feat(analytics): lower maturity window to 2 days and reword about page
This commit is contained in:
1 parent
b405fc5fd7
commit
e7034cfb84
11 files changed
+66
-28
No files matched your search
@@ -738,7 +738,7 @@ class DashboardQueries:
|
||||
]
|
||||
|
||||
if sort in duration_sorts:
|
||||
_, latest_end = day_bounds(latest)
|
||||
latest_start, _ = day_bounds(latest)
|
||||
minimum_seconds = max(0, int(analytics.min_duration_seconds))
|
||||
min_view = max(0, int(analytics.min_view_for_efficiency))
|
||||
items = [
|
||||
@@ -747,7 +747,7 @@ class DashboardQueries:
|
||||
and int(item["duration"] or 0) >= minimum_seconds
|
||||
and int((item["metrics"] or {}).get("view", 0)) >= min_view
|
||||
and is_mature(
|
||||
item["pubdate"], latest_end, analytics.maturity_days
|
||||
item["pubdate"], latest_start, analytics.maturity_days
|
||||
)
|
||||
]
|
||||
if sort == "interaction":
|
||||
@@ -1396,10 +1396,24 @@ class DashboardQueries:
|
||||
preview_row = conn.execute(
|
||||
"SELECT v FROM kv WHERE k = 'preview:seeded'"
|
||||
).fetchone()
|
||||
fans_start_date = None
|
||||
track_fans = [
|
||||
int(mid) for mid in cfg.track_fans if not isinstance(mid, bool)
|
||||
]
|
||||
if track_fans:
|
||||
placeholders = ",".join("?" for _ in track_fans)
|
||||
row = conn.execute(
|
||||
f"SELECT MIN(stat_date) AS d FROM up_stat "
|
||||
f"WHERE ok = 1 AND mid IN ({placeholders})",
|
||||
track_fans,
|
||||
).fetchone()
|
||||
fans_start_date = None if row is None else row["d"]
|
||||
return {
|
||||
"data_date": latest,
|
||||
"snapshot_days": self._snapshot_days(conn),
|
||||
"snapshot_first_date": first_date,
|
||||
"fans_start_date": fans_start_date,
|
||||
"track_fans": track_fans,
|
||||
"schema_version": int(self.db.schema_version or 0),
|
||||
"preview": bool(preview_row and str(preview_row["v"]) == "1"),
|
||||
"counts": counts,
|
||||
|
||||
Reference in new issue
Block a user