This commit is contained in:
Lea 2024-06-16 19:25:47 +02:00
parent b17a4efcb9
commit b83c5eab01
Signed by: Lea
GPG key ID: 1BAFFE8347019C42
2 changed files with 3 additions and 2 deletions

View file

@ -56,8 +56,6 @@ for (const c in config.pList) {
const canvas = createCanvas(config.w, config.h);
const ctx = canvas.getContext('2d');
console.log(categories);
const images: { layer: number, url: string }[] = [];
for (const category of categories.sort((a, b) => b.index - a.index)) {

View file

@ -76,6 +76,8 @@ export async function getAsset(url: string) {
// https://cdn.picrew.me/app/image_maker/{makerId}/{pId}/{random_string}.png
const [ makerId, cId, filename ] = new URL(url).pathname.split("/").slice(-3);
console.log(`Starting download: ${makerId}/${cId}/${filename}`);
const dir = path.join(dirname, "..", "cache", "assets", makerId, cId);
const filePath = path.join(dir, filename);
@ -86,5 +88,6 @@ export async function getAsset(url: string) {
await downloadToPath(url, filePath);
}
console.log(`Finished download: ${makerId}/${cId}/${filename}`);
return filePath;
}