mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
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.
This commit is contained in:
parent
43077bd259
commit
e1889d9151
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue