diff --git a/src/controllers/summary.rs b/src/controllers/summary.rs index 6a56102..2670051 100644 --- a/src/controllers/summary.rs +++ b/src/controllers/summary.rs @@ -21,8 +21,6 @@ pub async fn summary(state: AppState) -> AppResult> { spawn_blocking(move || { let conn: &mut AsyncConnectionWrapper<_> = &mut conn.into(); - let config = &state.config; - let num_bots: i64 = bots::table.count().get_result(conn)?; fn encode_bots(bot_list: Vec) -> AppResult> { @@ -50,8 +48,8 @@ pub async fn summary(state: AppState) -> AppResult> { // TODO: top rated, most voted Ok(Json(json!({ "num_bots": num_bots, - "new_bots": encode_bots( new_bots)?, - "just_updated": encode_bots( just_updated)?, + "new_bots": encode_bots(new_bots)?, + "just_updated": encode_bots(just_updated)?, "popular_categories": popular_categories, }))) }) diff --git a/src/views.rs b/src/views.rs index 0ff8e29..add41f0 100644 --- a/src/views.rs +++ b/src/views.rs @@ -165,14 +165,17 @@ pub struct OwnedBot { pub struct EncodableBot { pub id: String, pub name: String, + pub avatar: Option, + pub description: String, + pub short_description: String, + pub supported_languages: Vec>, + pub categories: Option>, + pub guild_count: i32, + pub status: String, #[serde(with = "rfc3339")] pub updated_at: NaiveDateTime, - pub categories: Option>, #[serde(with = "rfc3339")] pub created_at: NaiveDateTime, - pub description: String, - pub short_description: String, - pub supported_languages: Vec>, } impl EncodableBot { @@ -185,6 +188,9 @@ impl EncodableBot { description, short_description, supported_languages, + guild_count, + status, + avatar, .. } = bot; @@ -199,6 +205,9 @@ impl EncodableBot { description, short_description, supported_languages, + guild_count, + status: status.into(), + avatar, } }