Changed story.ListTags to ignore tags for unlisted stories

This commit is contained in:
2018-07-07 23:14:17 +02:00
parent 429387c9ac
commit 223d9922e9
+1 -1
View File
@@ -21,7 +21,7 @@ func (tag *Tag) Equal(other Tag) bool {
// ListTags lists all tags
func ListTags() ([]Tag, error) {
tags := make([]Tag, 0, 64)
err := storyCollection.Find(bson.M{"tags": bson.M{"$ne": nil}}).Distinct("tags", &tags)
err := storyCollection.Find(bson.M{"listed": true, "tags": bson.M{"$ne": nil}}).Distinct("tags", &tags)
sort.Slice(tags, func(i, j int) bool {
kindCmp := strings.Compare(tags[i].Kind, tags[j].Kind)