Return custom field values with search results

This commit is contained in:
Eike Kettner
2020-11-23 10:23:25 +01:00
parent 44459aecd0
commit 7b7f1e4d6d
3 changed files with 18 additions and 6 deletions

View File

@ -213,10 +213,11 @@ trait Conversions {
i.concEquip.map(mkIdName),
i.folder.map(mkIdName),
i.fileCount,
Nil,
Nil,
Nil, //attachments
Nil, //tags
Nil, //customfields
i.notes,
Nil
Nil // highlight
)
def mkItemLight(i: OFulltext.FtsItem): ItemLight = {
@ -227,7 +228,11 @@ trait Conversions {
def mkItemLightWithTags(i: OItemSearch.ListItemWithTags): ItemLight =
mkItemLight(i.item)
.copy(tags = i.tags.map(mkTag), attachments = i.attachments.map(mkAttachmentLight))
.copy(
tags = i.tags.map(mkTag),
attachments = i.attachments.map(mkAttachmentLight),
customfields = i.customfields.map(mkItemFieldValue)
)
private def mkAttachmentLight(qa: QItem.AttachmentLight): AttachmentLight =
AttachmentLight(qa.id, qa.position, qa.name, qa.pageCount)