From e1889d9151fca7352ba208c79849936f5100d5f6 Mon Sep 17 00:00:00 2001 From: Patrick Farwick <9168045+MinecraftPlaye@users.noreply.github.com> Date: Thu, 17 Feb 2022 16:31:28 +0000 Subject: [PATCH] Ignore files without a file extension Files which do not have a file extension are most likely not an image and should not be used as a page of a comic book. --- src/plugins/comicsPlayer/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/comicsPlayer/plugin.js b/src/plugins/comicsPlayer/plugin.js index d8abaa226..69882b65b 100644 --- a/src/plugins/comicsPlayer/plugin.js +++ b/src/plugins/comicsPlayer/plugin.js @@ -263,10 +263,12 @@ class ArchiveSource { await this.archive.extractFiles(); let files = await this.archive.getFilesArray(); + + // metadata files and files without a file extension should not be considered as a page files = files.filter((file) => { const name = file.file.name; const index = name.lastIndexOf('.'); - return index !== 1 && supportedFormats.includes(name.slice(index + 1)); + return index !== -1 && supportedFormats.includes(name.slice(index + 1)); }); files.sort((a, b) => { if (a.file.name < b.file.name) {