Skip to content

Commit e7e7815

Browse files
committed
New: Add suport for compressed LZH, ACE, TAR.GZ, TAR.XZ, TAR.BZIP2 and TAR.ZSTD
1 parent e7a5bf6 commit e7e7815

16 files changed

Lines changed: 481 additions & 392 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2727
- Authentication support for OPDS (Basic and Digest) [`11c3aa8`](https://github.com/ollm/OpenComic/commit/11c3aa88efbff8adcc3fabbf4b066dcb7120b10a)
2828
- Use safeStorage for passwords and tokens [`6178ded`](https://github.com/ollm/OpenComic/commit/6178dedf1afe13c56b68bd3bd68010d80d30fdc6
2929
- Change extraction of rar and tar to 7z to improve performance [`c0c2d6d`](https://github.com/ollm/OpenComic/commit/c0c2d6d61016241e70d4ee475e8d19567b8e71db
30+
- Add suport for compressed `LZH`, `ACE`, `TAR.GZ`, `TAR.XZ`, `TAR.BZIP2` and `TAR.ZSTD`
3031

3132
##### 🐛 Bug Fixes
3233

‎scripts/app.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ function extname(path)
8484
return p.extname(path).substr(1).toLowerCase();
8585
}
8686

87+
function extnameC(path)
88+
{
89+
return extract(/\.((?:tar\.)?[a-z0-9\-]+)$/i, path).toLowerCase();
90+
}
91+
8792
function round(number, precision = 0) {
8893

8994
multipler = Math.pow(10, precision);
@@ -388,6 +393,7 @@ module.exports = {
388393
eventOff: eventOff,
389394
empty: empty,
390395
extname: extname,
396+
extnameC: extnameC,
391397
round: round,
392398
roundDPR: roundDPR,
393399
floorDPR: floorDPR,

‎scripts/cache.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function processTheImageQueue(img = false)
4141

4242
let blob = false;
4343

44-
if(inArray(fileExtension(realPath), imageExtensions.blob)) // Convert unsupported images to blob
44+
if(compatible.image.blob(realPath)) // Convert unsupported images to blob
4545
blob = await workers.convertImageToBlob(realPath, {useThreads: 0.3/*0.4*/});
4646

4747
return new Promise(function(resolve, reject) {
@@ -75,9 +75,7 @@ async function processTheImageQueue(img = false)
7575

7676
async function addImageToQueue(file, size, sha, callback, vars, type, forceSize)
7777
{
78-
const extention = fileExtension(file);
79-
80-
if(inArray(extention, imageExtensions.convert)) // Convert unsupported images
78+
if(compatible.image.convert(file)) // Convert unsupported images
8179
await workers.convertImage(file);
8280

8381
threads.job('cache', {useThreads: 1}, processTheImageQueue, {file: file, size: size, sha: sha, callback: callback, vars: vars, type: type, forceSize: forceSize});

0 commit comments

Comments
 (0)