From 4999548a0cc463e7480413ed20b7710aefd806ce Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 2 Apr 2026 11:50:47 -0500 Subject: [PATCH] Show actual missing data counts instead of queued flags on backfill page --- lib/microwaveprop_web/live/backfill_live.ex | 49 ++++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/lib/microwaveprop_web/live/backfill_live.ex b/lib/microwaveprop_web/live/backfill_live.ex index 9f9e6745..084298de 100644 --- a/lib/microwaveprop_web/live/backfill_live.ex +++ b/lib/microwaveprop_web/live/backfill_live.ex @@ -85,15 +85,37 @@ defmodule MicrowavepropWeb.BackfillLive do end defp count_unprocessed do - Repo.one( - from(c in Contact, - where: - not is_nil(c.pos1) and - (c.hrrr_queued == false or c.weather_queued == false or - c.terrain_queued == false or c.iemre_queued == false), - select: count(c.id) + missing_terrain = + Repo.one( + from(c in Contact, + left_join: t in Microwaveprop.Terrain.TerrainProfile, on: t.qso_id == c.id, + where: not is_nil(c.pos1) and not is_nil(c.pos2) and is_nil(t.id), + select: count(c.id) + ) ) - ) + + missing_hrrr = + Repo.one( + from(c in Contact, + where: not is_nil(c.pos1) and c.hrrr_queued == false, + select: count(c.id) + ) + ) + + missing_weather = + Repo.one( + from(c in Contact, + where: not is_nil(c.pos1) and c.weather_queued == false, + select: count(c.id) + ) + ) + + %{ + terrain: missing_terrain, + hrrr: missing_hrrr, + weather: missing_weather, + total: max(missing_terrain, max(missing_hrrr, missing_weather)) + } end defp fetch_stats do @@ -148,15 +170,20 @@ defmodule MicrowavepropWeb.BackfillLive do
Enrichment Progress
-
{@unprocessed} remaining
+
{@unprocessed.total} remaining
- {@total_contacts - @unprocessed} / {@total_contacts} complete + {@total_contacts - @unprocessed.total} / {@total_contacts} complete
+
+ Terrain: {@unprocessed.terrain} + HRRR: {@unprocessed.hrrr} + Weather: {@unprocessed.weather} +
Active/Queued Jobs