mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
First sketch for custom data threaded through item processing
Refs: #2334
This commit is contained in:
@ -75,6 +75,7 @@ object ItemAddonTask extends AddonTaskExtension {
|
||||
givenMeta = proposals,
|
||||
tags = tags.map(_.name).toList,
|
||||
classifyProposals = MetaProposalList.empty,
|
||||
classifyTags = Nil
|
||||
classifyTags = Nil,
|
||||
customData = None // can't retain this information from a final item. TODO
|
||||
)
|
||||
}
|
||||
|
@ -112,7 +112,8 @@ object CreateItem {
|
||||
MetaProposalList.empty,
|
||||
Nil,
|
||||
MetaProposalList.empty,
|
||||
Nil
|
||||
Nil,
|
||||
ctx.args.meta.customData
|
||||
)
|
||||
}
|
||||
|
||||
@ -175,7 +176,8 @@ object CreateItem {
|
||||
MetaProposalList.empty,
|
||||
Nil,
|
||||
MetaProposalList.empty,
|
||||
Nil
|
||||
Nil,
|
||||
ctx.args.meta.customData
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -46,7 +46,8 @@ case class ItemData(
|
||||
tags: List[String],
|
||||
// proposals obtained from the classifier
|
||||
classifyProposals: MetaProposalList,
|
||||
classifyTags: List[String]
|
||||
classifyTags: List[String],
|
||||
customData: Option[Json]
|
||||
) {
|
||||
|
||||
/** sort by weight; order of equal weights is not important, just choose one others are
|
||||
@ -121,6 +122,7 @@ object ItemData {
|
||||
)
|
||||
)
|
||||
.asJson,
|
||||
"customData" -> data.customData.asJson,
|
||||
"tags" -> data.tags.asJson,
|
||||
"assumedTags" -> data.classifyTags.asJson,
|
||||
"assumedCorrOrg" -> data.finalProposals
|
||||
|
@ -101,7 +101,8 @@ object ReProcessItem {
|
||||
MetaProposalList.empty,
|
||||
Nil,
|
||||
MetaProposalList.empty,
|
||||
Nil
|
||||
Nil,
|
||||
None // cannot retain customData from an already existing item
|
||||
)).getOrElseF(
|
||||
Sync[F].raiseError(new Exception(s"Item not found: ${ctx.args.itemId.id}"))
|
||||
)
|
||||
@ -134,7 +135,8 @@ object ReProcessItem {
|
||||
None,
|
||||
None,
|
||||
true,
|
||||
None // attachOnly (not used when reprocessing attachments)
|
||||
None, // attachOnly (not used when reprocessing attachments)
|
||||
None // cannot retain customData from an already existing item
|
||||
),
|
||||
Nil
|
||||
).pure[F]
|
||||
|
@ -328,6 +328,7 @@ object ScanMailboxTask {
|
||||
args.tags.getOrElse(Nil),
|
||||
args.language,
|
||||
args.attachmentsOnly,
|
||||
None,
|
||||
None
|
||||
)
|
||||
data = OUpload.UploadData(
|
||||
|
Reference in New Issue
Block a user