feat(admin): overview dashboard sections + system temperature/load sensors (0.85.0) (#11)
This commit was merged in pull request #11.
This commit is contained in:
@@ -159,6 +159,24 @@ pub async fn manga_coverage(
|
||||
Ok((rows, total))
|
||||
}
|
||||
|
||||
/// Library-wide analysis coverage `(analyzed_pages, total_pages)` for the
|
||||
/// admin overview. `total_pages` is every page; `analyzed_pages` are those
|
||||
/// with a `done` analysis row.
|
||||
pub async fn library_coverage(pool: &PgPool) -> AppResult<(i64, i64)> {
|
||||
let row: (i64, i64) = sqlx::query_as(
|
||||
r#"
|
||||
SELECT
|
||||
count(*) FILTER (WHERE pa.status = 'done')::bigint AS analyzed,
|
||||
count(p.id)::bigint AS total
|
||||
FROM pages p
|
||||
LEFT JOIN page_analysis pa ON pa.page_id = p.id
|
||||
"#,
|
||||
)
|
||||
.fetch_one(pool)
|
||||
.await?;
|
||||
Ok(row)
|
||||
}
|
||||
|
||||
/// Per-chapter analysis coverage for one manga, ordered by chapter number.
|
||||
pub async fn chapter_coverage(
|
||||
pool: &PgPool,
|
||||
|
||||
Reference in New Issue
Block a user