diff --git a/lib/_run_pool-photo-generator.cjs b/lib/_run_pool-photo-generator.cjs index 6bfec70778..b07afea8bf 100644 --- a/lib/_run_pool-photo-generator.cjs +++ b/lib/_run_pool-photo-generator.cjs @@ -9,7 +9,7 @@ const PoolPhotoGenerator = require("../lib/pool-photo-generator.cjs").PoolPhotoGenerator; const inboundFolder = "../photos_new"; -const originalFolder = "../photos_original"; +const originalFolder = "../photos_original_transfer"; const poolFolder = "../static/pool"; const generator = new PoolPhotoGenerator(inboundFolder, originalFolder, poolFolder); diff --git a/lib/pool-photo-generator.cjs b/lib/pool-photo-generator.cjs index 8377324691..cd8bcd4b1a 100644 --- a/lib/pool-photo-generator.cjs +++ b/lib/pool-photo-generator.cjs @@ -33,9 +33,6 @@ class PoolPhotoGenerator { if (!fs.existsSync(_inboundFolder)) { throw "Inbound folder not found" } - if (!fs.existsSync(_originalFolder)) { - throw "Original folder not found" - } if (!fs.existsSync(_poolFolder)) { throw "Pool folder not found" } @@ -106,6 +103,7 @@ class PoolPhotoGenerator { Promise.all([processMeta, createMobile, createTablet, createNormal]) // .then(() => { //fs.unlinkSync(imgFile); // delete original image + if (!fs.existsSync(_originalFolder)) { fs.mkdirSync(_originalFolder); } fs.renameSync(imgFile, path.join(_originalFolder, file)); // move image }); } diff --git a/scripts/on-ready-generate-pool-photos.js b/scripts/on-ready-generate-pool-photos.js index 93ed1b05fa..707c888ec6 100644 --- a/scripts/on-ready-generate-pool-photos.js +++ b/scripts/on-ready-generate-pool-photos.js @@ -3,7 +3,7 @@ const PoolPhotoGenerator = require("../lib/pool-photo-generator.cjs").PoolPhotoG hexo.on("ready", function() { const inboundFolder = "../photos_new"; - const originalFolder = "../photos_original"; + const originalFolder = "../photos_original_transfer"; const poolFolder = "../static/pool"; const generator = new PoolPhotoGenerator(inboundFolder, originalFolder, poolFolder);