Fix crash: missing directory for generated PDFs
This commit is contained in:
@@ -207,6 +207,7 @@ class MainViewModel(
|
|||||||
|
|
||||||
private suspend fun generatePdf(): GeneratedPdf = withContext(Dispatchers.IO) {
|
private suspend fun generatePdf(): GeneratedPdf = withContext(Dispatchers.IO) {
|
||||||
val imageIds = imageRepository.imageIds()
|
val imageIds = imageRepository.imageIds()
|
||||||
|
pdfDir.mkdirs()
|
||||||
val file = File(pdfDir, "${System.currentTimeMillis()}.pdf")
|
val file = File(pdfDir, "${System.currentTimeMillis()}.pdf")
|
||||||
val jpegs = imageIds.asSequence()
|
val jpegs = imageIds.asSequence()
|
||||||
.map { id -> imageRepository.getContent(id) }
|
.map { id -> imageRepository.getContent(id) }
|
||||||
|
|||||||
Reference in New Issue
Block a user