Let's not search for title/authors for moderation

We have to find a more performant solution here.
This commit is contained in:
Las Zenow 2021-04-30 17:38:20 +00:00
parent 1e56da1c01
commit 3b2688bdfc

View file

@ -98,8 +98,9 @@ func moderateSubmissionsHandler(h handler) {
}
for i, b := range res {
data.Books[i].B = b
_, data.Books[i].TitleFound, _ = h.db.GetBooks("title:"+b.Title, 1, 0)
_, data.Books[i].AuthorFound, _ = h.db.GetBooks("author:"+strings.Join(b.Authors, " author:"), 1, 0)
// FIXME: there is a heavy performance issue searching for title/authors
//_, data.Books[i].TitleFound, _ = h.db.GetBooks("title:"+b.Title, 1, 0)
//_, data.Books[i].AuthorFound, _ = h.db.GetBooks("author:"+strings.Join(b.Authors, " author:"), 1, 0)
data.Books[i].Comment, err = h.db.GetComment(b.ID)
if err != nil {
log.Error("Error getting comment for ", b.Title, " (", b.ID, "): ", err)