2022-04-26 13:43:24 +02:00
|
|
|
|
|
|
|
const fsp = require('fs').promises;
|
2022-11-06 10:21:28 +01:00
|
|
|
const { resolve } = require('path');
|
2023-05-08 10:50:51 +02:00
|
|
|
const { howlongtobeat, youtube } = require('jam-my-stack');
|
2022-04-26 13:43:24 +02:00
|
|
|
|
|
|
|
|
2022-11-06 10:21:28 +01:00
|
|
|
// If this isn't resolved, jam-my-stack will fail to replace 'content' with 'static' when downloading covers.
|
|
|
|
const rootdir = resolve(`${__dirname}/..`);
|
2022-04-26 13:43:24 +02:00
|
|
|
|
|
|
|
(async function() {
|
2023-05-08 10:50:51 +02:00
|
|
|
console.log("--> adding Howlongtobeat info...")
|
2022-04-26 13:43:24 +02:00
|
|
|
await howlongtobeat.howlong({
|
|
|
|
postDir: `${rootdir}/content`,
|
2022-11-06 10:21:28 +01:00
|
|
|
downloadDir: `${rootdir}/static`
|
2022-04-26 13:43:24 +02:00
|
|
|
})
|
|
|
|
|
2023-05-08 10:50:51 +02:00
|
|
|
console.log("--> Generating YouTube thumbnails...")
|
2022-04-26 13:43:24 +02:00
|
|
|
await youtube.thumbify({
|
|
|
|
postDir: `${rootdir}/content`,
|
|
|
|
downloadDir: `${rootdir}/static/img/yt`,
|
|
|
|
overlayImg: `${rootdir}/play.png`
|
|
|
|
})
|
|
|
|
|
2023-05-08 10:50:51 +02:00
|
|
|
console.log("-- precommit: all done!")
|
2022-04-26 13:43:24 +02:00
|
|
|
})()
|