Migrated up to VersOne 3.3 with epub 3.3 support. (#1999)
This enables collection and reading list support from epubs.
This commit is contained in:
parent
466a0c8028
commit
1b06d98319
6 changed files with 71 additions and 179 deletions
|
@ -172,7 +172,7 @@ public class WordCountAnalyzerService : IWordCountAnalyzerService
|
|||
{
|
||||
using var book = await EpubReader.OpenBookAsync(filePath, BookService.BookReaderOptions);
|
||||
|
||||
var totalPages = book.Content.Html.Values;
|
||||
var totalPages = book.Content.Html.Local.Values;
|
||||
foreach (var bookPage in totalPages)
|
||||
{
|
||||
var progress = Math.Max(0F,
|
||||
|
@ -238,10 +238,10 @@ public class WordCountAnalyzerService : IWordCountAnalyzerService
|
|||
}
|
||||
|
||||
|
||||
private static async Task<int> GetWordCountFromHtml(EpubContentFileRef bookFile)
|
||||
private static async Task<int> GetWordCountFromHtml(EpubLocalTextContentFileRef bookFile)
|
||||
{
|
||||
var doc = new HtmlDocument();
|
||||
doc.LoadHtml(await bookFile.ReadContentAsTextAsync());
|
||||
doc.LoadHtml(await bookFile.ReadContentAsync());
|
||||
|
||||
var textNodes = doc.DocumentNode.SelectNodes("//body//text()[not(parent::script)]");
|
||||
if (textNodes == null) return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue