fixed a bug with the new PdfExtractor where Pdfs would have an extra page, generating an error when requested

This commit is contained in:
Gauthier Roebroeck 2019-09-07 10:50:26 +08:00
parent 6a5a6dc1f4
commit 7c260add4d
3 changed files with 7 additions and 2 deletions

View file

@ -19,7 +19,7 @@ plugins {
}
group = "org.gotson"
version = "0.3.0"
version = "0.3.1"
repositories {
jcenter()

View file

@ -19,7 +19,7 @@ class PdfExtractor : ArchiveExtractor() {
override fun getPagesList(path: Path): List<BookPage> =
PDDocument.load(Files.newInputStream(path)).use { pdf ->
(0..pdf.numberOfPages).map { index ->
(1..pdf.numberOfPages).map { index ->
BookPage(index.toString(), mediaType)
}
}

View file

@ -0,0 +1,5 @@
update BOOK_METADATA
set STATUS = 'UNKNOWN'
where ID in (
SELECT ID FROM BOOK_METADATA where MEDIA_TYPE = 'application/pdf'
);