mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Autoformat
This commit is contained in:
@ -59,9 +59,9 @@ object Migration {
|
||||
s"Applying index migration ${m.version}/${m.description} failed"
|
||||
) *>
|
||||
ctx.store.transact(RFtsMigration.deleteById(rec.id)) *> Effect[F]
|
||||
.raiseError[Unit](
|
||||
ex
|
||||
)
|
||||
.raiseError[Unit](
|
||||
ex
|
||||
)
|
||||
})
|
||||
} yield ret).getOrElseF(
|
||||
ctx.logger.info(s"Migration ${m.version}/${m.description} already applied.")
|
||||
|
@ -41,20 +41,19 @@ object CreateItem {
|
||||
.flatMap(f => ctx.store.bitpeace.get(f.fileMetaId.id).map(fm => (f, fm)))
|
||||
.collect({ case (f, Some(fm)) if isValidFile(fm) => f })
|
||||
.zipWithIndex
|
||||
.evalMap({
|
||||
case (f, index) =>
|
||||
Ident
|
||||
.randomId[F]
|
||||
.map(id =>
|
||||
RAttachment(
|
||||
id,
|
||||
itemId,
|
||||
f.fileMetaId,
|
||||
index.toInt + offset,
|
||||
now,
|
||||
f.name
|
||||
)
|
||||
.evalMap({ case (f, index) =>
|
||||
Ident
|
||||
.randomId[F]
|
||||
.map(id =>
|
||||
RAttachment(
|
||||
id,
|
||||
itemId,
|
||||
f.fileMetaId,
|
||||
index.toInt + offset,
|
||||
now,
|
||||
f.name
|
||||
)
|
||||
)
|
||||
})
|
||||
}
|
||||
.compile
|
||||
|
@ -82,10 +82,9 @@ object FindProposal {
|
||||
def removeDuplicates(labels: List[NerLabel]): List[NerLabel] =
|
||||
labels
|
||||
.sortBy(_.startPosition)
|
||||
.foldLeft((Set.empty[String], List.empty[NerLabel])) {
|
||||
case ((seen, result), el) =>
|
||||
if (seen.contains(el.tag.name + el.label.toLowerCase)) (seen, result)
|
||||
else (seen + (el.tag.name + el.label.toLowerCase), el :: result)
|
||||
.foldLeft((Set.empty[String], List.empty[NerLabel])) { case ((seen, result), el) =>
|
||||
if (seen.contains(el.tag.name + el.label.toLowerCase)) (seen, result)
|
||||
else (seen + (el.tag.name + el.label.toLowerCase), el :: result)
|
||||
}
|
||||
._2
|
||||
|
||||
|
@ -14,17 +14,16 @@ object InfoRoutes {
|
||||
def apply[F[_]: Sync](): HttpRoutes[F] = {
|
||||
val dsl = new Http4sDsl[F] {}
|
||||
import dsl._
|
||||
HttpRoutes.of[F] {
|
||||
case GET -> (Root / "version") =>
|
||||
Ok(
|
||||
VersionInfo(
|
||||
BuildInfo.version,
|
||||
BuildInfo.builtAtMillis,
|
||||
BuildInfo.builtAtString,
|
||||
BuildInfo.gitHeadCommit.getOrElse(""),
|
||||
BuildInfo.gitDescribedVersion.getOrElse("")
|
||||
)
|
||||
HttpRoutes.of[F] { case GET -> (Root / "version") =>
|
||||
Ok(
|
||||
VersionInfo(
|
||||
BuildInfo.version,
|
||||
BuildInfo.builtAtMillis,
|
||||
BuildInfo.builtAtString,
|
||||
BuildInfo.gitHeadCommit.getOrElse(""),
|
||||
BuildInfo.gitDescribedVersion.getOrElse("")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user