Integrate Inputs/PainterPalette.csv for artist metadata and influence links, add db/schema.sql with server/migrate.js, letterbox influence panel thumbnails, and refresh Titian/Pontormo images. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
807 B
JavaScript
28 lines
807 B
JavaScript
require('dotenv').config();
|
|
const pool = require('../server/db');
|
|
const { loadPainterPalette, findPaletteRow } = require('./painter-palette-lib');
|
|
|
|
async function main() {
|
|
const palette = loadPainterPalette();
|
|
const { rows: dbArtists } = await pool.query('SELECT name FROM artists ORDER BY name');
|
|
|
|
let matched = 0;
|
|
const unmatched = [];
|
|
for (const a of dbArtists) {
|
|
if (findPaletteRow(a.name, palette)) matched += 1;
|
|
else unmatched.push(a.name);
|
|
}
|
|
|
|
console.log('CSV rows:', palette.rowCount);
|
|
console.log('DB artists:', dbArtists.length);
|
|
console.log('Matched to PainterPalette:', matched, '/', dbArtists.length);
|
|
if (unmatched.length) console.log('Unmatched:', unmatched.join('; '));
|
|
|
|
await pool.end();
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|