mirror of
https://github.com/readest/readest.git
synced 2026-07-09 16:00:16 +00:00
Lazy loading of PDF documents
This commit is contained in:
parent
1e66ab816b
commit
ad8d249a3a
2 changed files with 2 additions and 8 deletions
|
|
@ -147,13 +147,7 @@ export abstract class BaseAppService implements AppService {
|
|||
|
||||
async loadBookContent(book: Book): Promise<BookContent> {
|
||||
const fp = getFilename(book);
|
||||
let file: File;
|
||||
if (fp.endsWith('.pdf')) {
|
||||
const content = await this.fs.readFile(fp, 'Books', 'binary');
|
||||
file = new File([content], fp, { type: 'application/pdf' });
|
||||
} else {
|
||||
file = await new RemoteFile(this.fs.getURL(`${this.localBooksDir}/${fp}`), fp).open();
|
||||
}
|
||||
let file = await new RemoteFile(this.fs.getURL(`${this.localBooksDir}/${fp}`), fp).open();
|
||||
return { book, file, config: await this.loadBookConfig(book) };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 337988cffcee09377fcc0216bddad3baf4ec2514
|
||||
Subproject commit 4f300c6f3fe0ec91ab35015873ba270762567477
|
||||
Loading…
Add table
Add a link
Reference in a new issue