Add a flag to processing task to distinguish re-/processing

This commit is contained in:
Eike Kettner 2021-03-12 00:33:51 +01:00
parent 76f5ab6c68
commit a7ee0aa08b
3 changed files with 10 additions and 3 deletions

View File

@ -145,7 +145,8 @@ object OUpload {
data.meta.validFileTypes,
data.meta.skipDuplicates,
data.meta.fileFilter.some,
data.meta.tags.some
data.meta.tags.some,
false
)
args =
if (data.multiple) files.map(f => ProcessItemArgs(meta, List(f)))

View File

@ -13,6 +13,8 @@ import io.circe.generic.semiauto._
*
* If the `itemId' is set to some value, the item is tried to load to
* ammend with the given files. Otherwise a new item is created.
*
* It is also re-used by the 'ReProcessItem' task.
*/
case class ProcessItemArgs(meta: ProcessMeta, files: List[File]) {
@ -24,6 +26,8 @@ case class ProcessItemArgs(meta: ProcessMeta, files: List[File]) {
case _ => s"${files.size} files from ${meta.sourceAbbrev}"
}
def isNormalProcessing: Boolean =
!meta.reprocess
}
object ProcessItemArgs {
@ -40,7 +44,8 @@ object ProcessItemArgs {
validFileTypes: Seq[MimeType],
skipDuplicate: Boolean,
fileFilter: Option[Glob],
tags: Option[List[String]]
tags: Option[List[String]],
reprocess: Boolean
)
object ProcessMeta {

View File

@ -107,7 +107,8 @@ object ReProcessItem {
Seq.empty,
false,
None,
None
None,
true
),
Nil
).pure[F]