Réorganisation des routes API et ajout de la gestion des téléchargements d'images
This commit is contained in:
@@ -7,9 +7,9 @@ async function checkAndRemoveInvalidEntries() {
|
||||
console.log('Checking for invalid entries...');
|
||||
try {
|
||||
const measurementsRes = await db.query('SELECT id, path FROM measurements');
|
||||
console.log('Fetched measurements:', measurementsRes.rows);
|
||||
//console.log('Fetched measurements:', measurementsRes.rows);
|
||||
for (const row of measurementsRes.rows) {
|
||||
console.log('Checking file path:', row.path);
|
||||
//console.log('Checking file path:', row.path);
|
||||
if (!fs.existsSync(row.path)) {
|
||||
// Remove invalid entry
|
||||
await db.query('DELETE FROM measurements WHERE id = $1', [row.id]);
|
||||
@@ -19,7 +19,7 @@ async function checkAndRemoveInvalidEntries() {
|
||||
|
||||
// Scan all images in storage
|
||||
const allImages = await storageManager.scanAllImages();
|
||||
console.log('Scanned all images:', allImages);
|
||||
//console.log('Scanned all images:', allImages);
|
||||
for (const imagePath of allImages) {
|
||||
const entryRes = await db.query('SELECT id FROM measurements WHERE path = $1', [imagePath]);
|
||||
if (entryRes.rows.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user