mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Correctly count tag categories
If multiple tags of the same category are applied to the same item, just summing tag counts will produce the wrong results as now items are counted multiple times.
This commit is contained in:
@ -31,6 +31,7 @@ trait Conversions {
|
||||
SearchStats(
|
||||
sum.count,
|
||||
mkTagCloud(sum.tags),
|
||||
mkTagCategoryCloud(sum.cats),
|
||||
sum.fields.map(mkFieldStats),
|
||||
sum.folders.map(mkFolderStats)
|
||||
)
|
||||
@ -63,6 +64,9 @@ trait Conversions {
|
||||
def mkTagCloud(tags: List[OCollective.TagCount]) =
|
||||
TagCloud(tags.map(tc => TagCount(mkTag(tc.tag), tc.count)))
|
||||
|
||||
def mkTagCategoryCloud(tags: List[OCollective.CategoryCount]) =
|
||||
NameCloud(tags.map(tc => NameCount(tc.category, tc.count)))
|
||||
|
||||
// attachment meta
|
||||
def mkAttachmentMeta(rm: RAttachmentMeta): AttachmentMeta =
|
||||
AttachmentMeta(
|
||||
|
Reference in New Issue
Block a user