From efe669b874f9d511912566fcfb97e52026a2085b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 22 Sep 2023 11:58:11 -0400 Subject: [PATCH] Remove redundant query on post pages Previously, we'd call GetCollectionAttribute for the monetization attribute, when it's already in the collection data. --- posts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts.go b/posts.go index 4bc5633..dfa6e51 100644 --- a/posts.go +++ b/posts.go @@ -1547,7 +1547,7 @@ Are you sure it was ever here?`, tp.CanInvite = canUserInvite(app.cfg, tp.IsAdmin) tp.PinnedPosts, _ = app.db.GetPinnedPosts(coll, p.IsOwner) tp.IsPinned = len(*tp.PinnedPosts) > 0 && PostsContains(tp.PinnedPosts, p) - tp.Monetization = app.db.GetCollectionAttribute(coll.ID, "monetization_pointer") + tp.Monetization = coll.Monetization tp.Verification = coll.Verification if !postFound {