From 87c48f2b21aa5e69b26a2e92286aa89a2f09aced Mon Sep 17 00:00:00 2001 From: Rodrigo-017 <137452679+Rodrigo-017@users.noreply.github.com> Date: Fri, 23 Jun 2023 14:31:24 -0300 Subject: [PATCH] Update Chapter.mjs --- src/web/mjs/engine/Chapter.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/mjs/engine/Chapter.mjs b/src/web/mjs/engine/Chapter.mjs index 43164ea81c..064b6f2ef1 100644 --- a/src/web/mjs/engine/Chapter.mjs +++ b/src/web/mjs/engine/Chapter.mjs @@ -111,9 +111,9 @@ export default class Chapter extends EventTarget { this.manga.connector._getPageList( this.manga, this, ( error, pages ) => { this.pageCache = []; if( !error ) { - if(pages.length || pages.video || pages.mirrors && pages.mirrors.length) { + if(pages?.length || pages?.video || pages?.mirrors && pages?.mirrors.length) { // HACK: bypass 'i0.wp.com' image CDN to ensure original images are loaded directly from host - this.pageCache = Array.isArray(pages) ? pages.map(page => page.replace(/\/i\d+\.wp\.com/, '')) : pages; + this.pageCache = Array.isArray(pages) ? pages.map(page => page.legacy.replace(/\/i\d+\.wp\.com/, '')) : pages; } else { error = new Error(`There was no content found for '${this.title}', make sure it is accessible (login, purchase, ...)!`); } @@ -126,4 +126,4 @@ export default class Chapter extends EventTarget { } ); } } -} \ No newline at end of file +}