Add first drafts for converting

This commit is contained in:
Eike Kettner
2020-02-18 01:31:22 +01:00
parent c665c212a0
commit bd605b8c94
10 changed files with 266 additions and 42 deletions

View File

@ -51,11 +51,11 @@ object ConvertPdf {
.map(_.mimetype)
.getOrElse(Mimetype.`application/octet-stream`)
def convertSafe[F[_]: Sync](
def convertSafe[F[_]: Sync: ContextShift](
cfg: ConvertConfig,
ctx: Context[F, ProcessItemArgs]
)(ra: RAttachment, mime: Mimetype): F[RAttachment] =
Conversion.create[F](cfg).use { conv =>
Conversion.create[F](cfg, ctx.blocker,ctx.logger).use { conv =>
ctx.logger
.info(s"File ${ra.name} has mime ${mime.asString}. conv=$conv")
.map(_ => ra)