aboutsummaryrefslogtreecommitdiff
path: root/CacheDatabase.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-28 21:03:46 -0800
committerFChannel <=>2021-01-28 21:03:46 -0800
commit74f5fb1e96e4c18d87ffe6838f4ab448c184ccff (patch)
tree288ec698036a0c47799e416047fdb902f5d63e1c /CacheDatabase.go
parente358eb07ec4ce873f750c0b75d7b23df4da2fbb8 (diff)
quote bug fix
Diffstat (limited to 'CacheDatabase.go')
-rw-r--r--CacheDatabase.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/CacheDatabase.go b/CacheDatabase.go
index d5f9c97..84a18d0 100644
--- a/CacheDatabase.go
+++ b/CacheDatabase.go
@@ -404,7 +404,7 @@ func GetObjectRepliesCache(db *sql.DB, parent ObjectBase) (*CollectionBase, int,
var postCnt int
var imgCnt int
- post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesDB(db, post)
+ post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesCache(db, post)
post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesCacheCount(db, post)
@@ -445,18 +445,30 @@ func GetObjectRepliesRepliesCache(db *sql.DB, parent ObjectBase) (*CollectionBas
err = rows.Scan(&post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.AttributedTo, &attachID, &previewID, &actor.Id)
-
CheckError(err, "error with replies replies cache scan")
post.Actor = &actor
post.Attachment = GetObjectAttachmentCache(db, attachID)
- post.Preview = GetObjectPreviewCache(db, previewID)
+ post.Preview = GetObjectPreviewCache(db, previewID)
result = append(result, post)
}
+ nColl.OrderedItems = result
+
+ remoteCollection, postc, imgc := GetObjectRepliesReplies(db, parent)
+
+ for _, e := range remoteCollection.OrderedItems {
+
+ nColl.OrderedItems = append(nColl.OrderedItems, e)
+ postc = postc + 1
+ if len(e.Attachment) > 0 {
+ imgc = imgc + 1
+ }
+ }
+
return &nColl, 0, 0
}