Tidy up logging

Looks like we'll need some disk-based cache, as it's still making 
multiple requests
pull/1/head
Starbeamrainbowlabs 2021-10-17 14:52:25 +01:00
parent 90c7a470a7
commit 5a549e67a9
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2
2 changed files with 2 additions and 4 deletions

View File

@ -18,14 +18,12 @@ function hash(str) {
}
async function filter_asset(src) {
process.stdout.write(`ASSET ${src} `);
let target_dir = `../_site/img`;
if(!fs.existsSync(target_dir))
await fs.promises.mkdir(target_dir, { recursive: true });
let filename = path.basename(src);
if(src.search(/^https?:(?:\/\/)?/) > -1) {
console.log(`URL`);
let content = await fetch(src, "none");
// Determine the file type extension
@ -47,7 +45,6 @@ async function filter_asset(src) {
);
}
else {
console.log(`LOCAL`);
// Generally speaking we optimise PNGs *very* well with oxipng/Zopfli,
// and the Image plugin doesn't respect this
await fs.promises.copyFile(src, path.join(target_dir, filename));

View File

@ -73,7 +73,8 @@ async function do_feeds() {
item.media_image = temp_image[1];
}
item.media_image_notfound = item.media_image == `./images/post.svg`;
console.log(`MEDIA IMAGE`, item.media_image);
if(!item.media_image_notfound)
console.log(`MEDIA IMAGE`, item.media_image);
if(typeof process.env["DEBUG_FEEDITEMS"] != "undefined")
console.log(`FEED ITEM`, item);