mirror of
https://github.com/janeczku/calibre-web
synced 2025-11-16 06:57:12 +00:00
restructured and fixed a bug in getprevfilesize
This commit is contained in:
@@ -8,9 +8,10 @@ class EpubParser {
|
|||||||
|
|
||||||
getTextByteLength() {
|
getTextByteLength() {
|
||||||
let size = 0;
|
let size = 0;
|
||||||
for (let key in y = Object.keys(this.files)) {
|
for (let key of Object.keys(this.files)) {
|
||||||
let file = this.files[y[key]];
|
let file = this.files[key];
|
||||||
if (file.name.endsWith("html")) {
|
if (file.name.endsWith("html")) {
|
||||||
|
console.log(file.name+" "+file._data.uncompressedSize)
|
||||||
size += file._data.uncompressedSize;
|
size += file._data.uncompressedSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,9 +66,10 @@ class EpubParser {
|
|||||||
let bytesize = 0;
|
let bytesize = 0;
|
||||||
for (let file of this.getSpine()) {
|
for (let file of this.getSpine()) {
|
||||||
if (file !== currentFile) {
|
if (file !== currentFile) {
|
||||||
let filepath = this.absPath(this.resolveIDref(currentFile));
|
let filepath = this.absPath(this.resolveIDref(file));
|
||||||
//ignore non text files
|
//ignore non text files
|
||||||
if (filepath.endsWith("html")) {
|
if (filepath.endsWith("html")) {
|
||||||
|
console.log(filepath+" "+bytesize)
|
||||||
bytesize += this.files[filepath]._data.uncompressedSize;
|
bytesize += this.files[filepath]._data.uncompressedSize;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user