mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Fix converted filename
Mark it by default with a string from the config file. Issue: 397
This commit is contained in:
@ -328,6 +328,11 @@ docspell.joex {
|
||||
# as used with the rest server.
|
||||
chunk-size = 524288
|
||||
|
||||
# A string used to change the filename of the converted pdf file.
|
||||
# If empty, the original file name is used for the pdf file ( the
|
||||
# extension is always replaced with `pdf`).
|
||||
converted-filename-part = "converted"
|
||||
|
||||
# When reading images, this is the maximum size. Images that are
|
||||
# larger are not processed.
|
||||
max-image-size = ${docspell.joex.extraction.ocr.max-image-size}
|
||||
|
@ -135,7 +135,11 @@ object ConvertPdf {
|
||||
) = {
|
||||
val hint =
|
||||
MimeTypeHint.advertised(MimeType.pdf).withName(ra.name.getOrElse("file.pdf"))
|
||||
val newName = ra.name.map(n => s"$n.pdf")
|
||||
val newName =
|
||||
ra.name
|
||||
.map(FileName.apply)
|
||||
.map(_.withExtension("pdf").withPart(cfg.convertedFilenamePart, '.'))
|
||||
.map(_.fullName)
|
||||
ctx.store.bitpeace
|
||||
.saveNew(pdf, cfg.chunkSize, MimetypeHint(hint.filename, hint.advertised))
|
||||
.compile
|
||||
|
Reference in New Issue
Block a user