From b2af865d7c61c931253896dcd42104fc6e19166d Mon Sep 17 00:00:00 2001 From: Guillaume Hivert Date: Thu, 5 Sep 2024 12:45:29 +0200 Subject: [PATCH] fix: remove funtil and dew, add better indication on stats --- apps/backend/src/backend/postgres/queries.gleam | 2 ++ apps/frontend/src/frontend/view/body/body.gleam | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/backend/src/backend/postgres/queries.gleam b/apps/backend/src/backend/postgres/queries.gleam index c21e04b..80372cd 100644 --- a/apps/backend/src/backend/postgres/queries.gleam +++ b/apps/backend/src/backend/postgres/queries.gleam @@ -92,6 +92,8 @@ pub fn select_more_popular_packages(db: pgo.Connection) { "SELECT name, repository, rank, (popularity -> 'github')::int FROM package WHERE popularity -> 'github' IS NOT NULL + AND name != 'funtil' + AND name != 'dew' ORDER BY popularity -> 'github' DESC LIMIT 23" |> pgo.execute(db, [], decoder) diff --git a/apps/frontend/src/frontend/view/body/body.gleam b/apps/frontend/src/frontend/view/body/body.gleam index 6e81112..ac20589 100644 --- a/apps/frontend/src/frontend/view/body/body.gleam +++ b/apps/frontend/src/frontend/view/body/body.gleam @@ -349,19 +349,19 @@ fn view_analytics(model: Model) { ]), h.div([a.class("analytics-charts-wrapper")], [popularity_chart(model)]), analytics_title( - "Most used packages — Used as dependencies on Hex", + "Most used packages — Used as dependencies on Hex, counted by release", False, ), h.div([a.class("analytics-box-wrapper")], [ analytics_box( - "Packages using gleam_stdlib", + "Packages releases using gleam_stdlib", model.ranked |> list.find(fn(p) { p.name == "gleam_stdlib" }) |> result.map(fn(p) { p.rank }) |> result.unwrap(0), ), analytics_box( - "Packages using gleeunit", + "Packages releases using gleeunit", model.ranked |> list.find(fn(p) { p.name == "gleeunit" }) |> result.map(fn(p) { p.rank })