mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
90b16b7f74
commit
31264e1122
@ -10,6 +10,7 @@ import io.legado.app.data.entities.BookChapter
|
||||
import io.legado.app.help.book.BookHelp
|
||||
import io.legado.app.utils.FileUtils
|
||||
import io.legado.app.utils.HtmlFormatter
|
||||
import io.legado.app.utils.isXml
|
||||
import io.legado.app.utils.printOnDebug
|
||||
import me.ag2s.epublib.domain.EpubBook
|
||||
import me.ag2s.epublib.domain.Resource
|
||||
@ -246,7 +247,7 @@ class EpubFile(var book: Book) {
|
||||
getElementsByTag("h4").remove()
|
||||
getElementsByTag("h5").remove()
|
||||
getElementsByTag("h6").remove()
|
||||
//getElementsMatchingOwnText(chapter.title)?.remove()
|
||||
//getElementsMatchingOwnText(chapter.title)?.remove()
|
||||
}
|
||||
}
|
||||
return bodyElement
|
||||
@ -275,7 +276,12 @@ class EpubFile(var book: Book) {
|
||||
book.author = author
|
||||
}
|
||||
if (metadata.descriptions.size > 0) {
|
||||
book.intro = Jsoup.parse(metadata.descriptions[0]).text()
|
||||
val desc = metadata.descriptions[0]
|
||||
book.intro = if (desc.isXml()) {
|
||||
Jsoup.parse(metadata.descriptions[0]).text()
|
||||
} else {
|
||||
desc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class EpubWriter {
|
||||
epubWriterProcessor.setTotalProgress(epubWriterProcessor.getTotalProgress() + book.getResources().size());
|
||||
book = processBook(book);
|
||||
ZipOutputStream resultStream = new ZipOutputStream(out);
|
||||
resultStream.setLevel(ZipOutputStream.STORED);
|
||||
//resultStream.setLevel(ZipOutputStream.STORED);
|
||||
writeMimeType(resultStream);
|
||||
writeContainer(resultStream);
|
||||
initTOCResource(book);
|
||||
|
Loading…
Reference in New Issue
Block a user