Fix compile warnings after scala update

This commit is contained in:
eikek
2024-03-03 18:43:54 +01:00
parent 3e76385d08
commit 924aaf720e
79 changed files with 383 additions and 256 deletions

View File

@ -30,7 +30,7 @@ object EmptyTrashTask {
UserTask(
args.periodicTaskId,
EmptyTrashArgs.taskName,
true,
enabled = true,
ce,
None,
args

View File

@ -29,23 +29,23 @@ object FileCopyTask {
case class CopyResult(success: Boolean, message: String, counter: List[Counter])
object CopyResult {
def noSourceImpl: CopyResult =
CopyResult(false, "No source BinaryStore implementation found!", Nil)
CopyResult(success = false, "No source BinaryStore implementation found!", Nil)
def noTargetImpl: CopyResult =
CopyResult(false, "No target BinaryStore implementation found!", Nil)
CopyResult(success = false, "No target BinaryStore implementation found!", Nil)
def noSourceStore(id: Ident): CopyResult =
CopyResult(
false,
success = false,
s"No source file repo found with id: ${id.id}. Make sure it is present in the config.",
Nil
)
def noTargetStore: CopyResult =
CopyResult(false, "No target file repositories defined", Nil)
CopyResult(success = false, "No target file repositories defined", Nil)
def success(counter: NonEmptyList[Counter]): CopyResult =
CopyResult(true, "Done", counter.toList)
CopyResult(success = true, "Done", counter.toList)
implicit val binaryIdCodec: Codec[BinaryId] =
Codec.from(
@ -96,8 +96,10 @@ object FileCopyTask {
.fromList(targets.filter(_ != srcConfig))
.toRight(CopyResult.noTargetStore)
srcRepo = store.createFileRepository(srcConfig, true)
targetRepos = trgConfig.map(store.createFileRepository(_, false))
srcRepo = store.createFileRepository(srcConfig, withAttributeStore = true)
targetRepos = trgConfig.map(
store.createFileRepository(_, withAttributeStore = false)
)
} yield (srcRepo, targetRepos)
data match {

View File

@ -13,8 +13,8 @@ case class CleanupResult(removed: Int, disabled: Boolean) {
def asString = if (disabled) "disabled" else s"$removed"
}
object CleanupResult {
def of(n: Int): CleanupResult = CleanupResult(n, false)
def disabled: CleanupResult = CleanupResult(0, true)
def of(n: Int): CleanupResult = CleanupResult(n, disabled = false)
def disabled: CleanupResult = CleanupResult(0, disabled = true)
implicit val jsonEncoder: Encoder[CleanupResult] =
deriveEncoder

View File

@ -55,7 +55,7 @@ object HouseKeepingTask {
UserTask(
periodicId,
taskName,
true,
enabled = true,
ce,
"Docspell house-keeping".some,
()

View File

@ -222,13 +222,13 @@ object FindProposal {
def searchExact[F[_]: Sync](ctx: Context[F, Args], store: Store[F]): Finder[F] =
labels =>
labels.toList
.traverse(nl => search(nl, true, ctx, store))
.traverse(nl => search(nl, exact = true, ctx, store))
.map(MetaProposalList.flatten)
def searchFuzzy[F[_]: Sync](ctx: Context[F, Args], store: Store[F]): Finder[F] =
labels =>
labels.toList
.traverse(nl => search(nl, false, ctx, store))
.traverse(nl => search(nl, exact = false, ctx, store))
.map(MetaProposalList.flatten)
}

View File

@ -131,10 +131,10 @@ object ReProcessItem {
data.item.source, // source-id
None, // folder
Seq.empty,
false,
skipDuplicate = false,
None,
None,
true,
reprocess = true,
None, // attachOnly (not used when reprocessing attachments)
None // cannot retain customData from an already existing item
),

View File

@ -75,7 +75,7 @@ object TextAnalysis {
analyser: TextAnalyser[F],
nerFile: RegexNerFile[F]
)(rm: RAttachmentMeta): F[(RAttachmentMeta, AttachmentDates)] = {
val settings = NlpSettings(ctx.args.meta.language, false, None)
val settings = NlpSettings(ctx.args.meta.language, highRecall = false, None)
for {
customNer <- nerFile.makeFile(ctx.args.meta.collective)
sett = settings.copy(regexNer = customNer)

View File

@ -28,7 +28,7 @@ object JoexRoutes {
for {
_ <- app.scheduler.notifyChange
_ <- app.periodicScheduler.notifyChange
resp <- Ok(BasicResult(true, "Schedulers notified."))
resp <- Ok(BasicResult(success = true, "Schedulers notified."))
} yield resp
case GET -> Root / "running" =>
@ -43,7 +43,7 @@ object JoexRoutes {
_ <- Async[F].start(
Temporal[F].sleep(Duration.seconds(1).toScala) *> app.initShutdown
)
resp <- Ok(BasicResult(true, "Shutdown initiated."))
resp <- Ok(BasicResult(success = true, "Shutdown initiated."))
} yield resp
case GET -> Root / "job" / Ident(id) =>
@ -54,7 +54,9 @@ object JoexRoutes {
job <- optJob
log <- optLog
} yield mkJobLog(job, log)
resp <- jAndL.map(Ok(_)).getOrElse(NotFound(BasicResult(false, "Not found")))
resp <- jAndL
.map(Ok(_))
.getOrElse(NotFound(BasicResult(success = false, "Not found")))
} yield resp
case POST -> Root / "job" / Ident(id) / "cancel" =>

View File

@ -323,7 +323,7 @@ object ScanMailboxTask {
s"mailbox-${ctx.args.account.login.id}",
args.itemFolder,
Seq.empty,
true,
skipDuplicates = true,
args.fileFilter.getOrElse(Glob.all),
args.tags.getOrElse(Nil),
args.language,