feat(directory): removed portrait and add cache for image and audio
This commit is contained in:
@@ -36,10 +36,7 @@ export default class AssetsProcessor {
|
||||
const croppedBuffer = await this.#alphaCompositer.crop(portraitBuffer, rect)
|
||||
await write(croppedBuffer, path.join(this.#operatorSourceFolder, this.#operatorName, `${fallback_name}_portrait.png`))
|
||||
|
||||
return {
|
||||
landscape: await this.#generateAssets(__config.operators[this.#operatorName].filename, extractedDir),
|
||||
portrait: __config.operators[this.#operatorName].portrait ? await this.#generateAssets(__config.operators[this.#operatorName].portrait, extractedDir) : null
|
||||
}
|
||||
return await this.#generateAssets(__config.operators[this.#operatorName].filename, extractedDir)
|
||||
}
|
||||
|
||||
async #generateAssets(filename, extractedDir) {
|
||||
|
||||
@@ -28,8 +28,5 @@ export default function () {
|
||||
writeSync(JSON.stringify(directoryJson, null), path.join(targetFolder, "directory.json"))
|
||||
filesToCopy.forEach((key) => {
|
||||
copy(path.join(sourceFolder, key, 'assets.json'), path.join(targetFolder, `${__config.operators[key].filename}.json`))
|
||||
if (__config.operators[key].portrait) {
|
||||
copy(path.join(sourceFolder, key, 'assets_portrait.json'), path.join(targetFolder, `${__config.operators[key].portrait}.json`))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user