1

Correction de l'attribution automatique

This commit is contained in:
2025-11-06 20:29:05 +01:00
parent 63609e3773
commit 5620633a42

View File

@@ -309,7 +309,7 @@ async function main() {
const nameNoExt = base.replace(/\.[^.]+$/, '');
const yamlPath = path.join(dataImagesDir, `${nameNoExt}.yaml`);
const titleForSetImage = (setDetails.name || selected.name || '').replace(/"/g, '\\"');
const yaml = `attribution: "© Rebrickable"\n` +
const yaml = `attribution: "© [Rebrickable](https://rebrickable.com/)"\n` +
`title: "${titleForSetImage}"\n`;
await fs.writeFile(yamlPath, yaml, 'utf8');
}
@@ -356,8 +356,12 @@ async function main() {
const nameNoExt = base.replace(/\.[^.]+$/, '');
const yamlPath = path.join(dataImagesDir, `${nameNoExt}.yaml`);
const yaml = `attribution: "© Rebrickable"\n` +
`title: "${(figTitle || '').replace(/"/g, '\\"')}"\n`;
const cleanedTitle = (figTitle || '').trim();
const yamlLines = [`attribution: "© Rebrickable"`];
if (cleanedTitle) {
yamlLines.push(`title: "${cleanedTitle.replace(/"/g, '\\"')}"`);
}
const yaml = `${yamlLines.join('\n')}\n`;
await fs.writeFile(yamlPath, yaml, 'utf8');
}
}