Compare commits
3 Commits
c7c62e220d
...
7372b560b2
Author | SHA1 | Date |
---|---|---|
|
7372b560b2 | |
|
9d638c685c | |
|
5da1acc38d |
|
@ -320,6 +320,8 @@ module.exports = {
|
|||
},
|
||||
media: {
|
||||
path: './media',
|
||||
maxSize: 1000,
|
||||
quality: 80,
|
||||
thumbnailSize: 320, // width for 16:9 will be exactly 576px
|
||||
thumbnailQuality: 100,
|
||||
lazySize: 90,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.206.11",
|
||||
"version": "1.207.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "traxxx",
|
||||
"version": "1.206.11",
|
||||
"version": "1.207.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@casl/ability": "^5.2.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.206.11",
|
||||
"version": "1.207.0",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
|
20
src/media.js
20
src/media.js
|
@ -345,12 +345,13 @@ async function writeImage(image, media, info, filepath, isProcessed) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (isProcessed) {
|
||||
// convert to JPEG and write to permanent location
|
||||
await image
|
||||
.jpeg()
|
||||
.toFile(path.join(config.media.path, filepath));
|
||||
}
|
||||
await image
|
||||
.resize({
|
||||
height: config.media.maxSize,
|
||||
withoutEnlargement: true,
|
||||
})
|
||||
.jpeg({ quality: config.media.quality })
|
||||
.toFile(path.join(config.media.path, filepath));
|
||||
}
|
||||
|
||||
async function writeThumbnail(image, thumbpath) {
|
||||
|
@ -416,12 +417,14 @@ async function storeImageFile(media, hashDir, hashSubDir, filename, filedir, fil
|
|||
});
|
||||
}
|
||||
|
||||
await writeImage(image, media, info, filepath, isProcessed);
|
||||
|
||||
await Promise.all([
|
||||
writeImage(image, media, info, filepath, isProcessed),
|
||||
writeThumbnail(image, thumbpath),
|
||||
writeLazy(image, lazypath),
|
||||
]);
|
||||
|
||||
/*
|
||||
if (isProcessed) {
|
||||
// file already stored, remove temporary file
|
||||
await fsPromises.unlink(media.file.path);
|
||||
|
@ -429,6 +432,9 @@ async function storeImageFile(media, hashDir, hashSubDir, filename, filedir, fil
|
|||
// image not processed, simply move temporary file to final location
|
||||
await fsPromises.rename(media.file.path, path.join(config.media.path, filepath));
|
||||
}
|
||||
*/
|
||||
|
||||
await fsPromises.unlink(media.file.path);
|
||||
|
||||
if (config.s3.enabled) {
|
||||
await Promise.all([
|
||||
|
|
Loading…
Reference in New Issue