Update for v4-rc5 of doc library

This commit is contained in:
2024-09-18 19:54:45 -04:00
parent 0032d15c0a
commit 870f87cb17
11 changed files with 15 additions and 22 deletions
@@ -43,16 +43,14 @@ type SQLiteCategoryData(conn: SqliteConnection, ser: JsonSerializer, log: ILogge
ordered
|> Seq.map (fun it -> backgroundTask {
// Parent category post counts include posts in subcategories
let childCats =
let childField =
ordered
|> Seq.filter (fun cat -> cat.ParentNames |> Array.contains it.Name)
|> Seq.map _.Id
|> Seq.append (Seq.singleton it.Id)
|> Seq.map box
|> Field.InArray (nameof Post.Empty.CategoryIds) Table.Post
let fields =
[ webLogField webLogId
Field.Equal (nameof Post.Empty.Status) (string Published)
Field.InArray (nameof Post.Empty.CategoryIds) Table.Post childCats ]
[ webLogField webLogId; Field.Equal (nameof Post.Empty.Status) (string Published); childField ]
let query =
(Query.statementWhere (Query.count Table.Post) (Query.whereByFields All fields))
.Replace("(*)", $"(DISTINCT data->>'{nameof Post.Empty.Id}')")