mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
Only use comic pages for internal calculations
A comic book archive stores pages as images, but can store other information like metadata within the file, too. This change uses only the image based files as pages and ignores other files.
This commit is contained in:
parent
390d9cc213
commit
14083377d1
@ -259,7 +259,15 @@ class ArchiveSource {
|
||||
this.raw = await this.archive.getFilesArray();
|
||||
await this.archive.extractFiles();
|
||||
|
||||
const files = await this.archive.getFilesArray();
|
||||
// the comic book archive supports any kind of image format as it's just a zip archive
|
||||
const supportedFormats = ['jpg', 'png', 'avif', 'gif', 'bmp', 'dib', 'tiff', 'tif'];
|
||||
|
||||
let files = await this.archive.getFilesArray();
|
||||
files = files.filter((file) => {
|
||||
const name = file.file.name;
|
||||
const index = name.lastIndexOf('.');
|
||||
return supportedFormats.includes(name.substr(index + 1));
|
||||
});
|
||||
files.sort((a, b) => {
|
||||
if (a.file.name < b.file.name) {
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user