aboutsummaryrefslogtreecommitdiff
path: root/outboxGet.go
diff options
context:
space:
mode:
Diffstat (limited to 'outboxGet.go')
-rw-r--r--outboxGet.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/outboxGet.go b/outboxGet.go
index 665ca05..1065ad9 100644
--- a/outboxGet.go
+++ b/outboxGet.go
@@ -68,10 +68,15 @@ func GetCollectionFromPath(db *sql.DB, path string) Collection {
post.InReplyTo = GetInReplyToDB(db, post)
- post.Replies = GetObjectRepliesDB(db, post)
+ var postCnt int
+ var imgCnt int
+ post.Replies, postCnt, imgCnt = GetObjectRepliesDB(db, post)
post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesDBCount(db, post)
+ post.Replies.TotalItems = post.Replies.TotalItems + postCnt
+ post.Replies.TotalImgs = post.Replies.TotalImgs + imgCnt
+
post.Attachment = GetObjectAttachment(db, attachID)
post.Preview = GetObjectPreview(db, previewID)
@@ -108,10 +113,16 @@ func GetObjectFromPath(db *sql.DB, path string) ObjectBase{
CheckError(err, "error scan object into post struct from path")
- post.Replies = GetObjectRepliesDB(db, post)
+
+ var postCnt int
+ var imgCnt int
+ post.Replies, postCnt, imgCnt = GetObjectRepliesDB(db, post)
post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesDBCount(db, post)
+ post.Replies.TotalItems = post.Replies.TotalItems + postCnt
+ post.Replies.TotalImgs = post.Replies.TotalImgs + imgCnt
+
post.Attachment = GetObjectAttachment(db, attachID)
post.Preview = GetObjectPreview(db, previewID)