Nettoyer le code en supprimant les importations inutilisées et en décommentant des fonctions pour améliorer la lisibilité.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import db from '../../db.js';
|
||||
import path from 'path';
|
||||
import storageManager from '../data/storageManager.js';
|
||||
import fs from 'fs';
|
||||
const db = require('../../db.js');
|
||||
const storageManager = require('../data/storageManager.js');
|
||||
const fs = require('fs');
|
||||
|
||||
let localCounter = 0;
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ async function scanAllImages(dir = 'storage') {
|
||||
}
|
||||
|
||||
async function saveFile(filePath, content) {
|
||||
let Buffer=Buffer.from(content, 'base64');
|
||||
if (Buffer.isBuffer(content)) {
|
||||
await fs.writeFile(filePath, content);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import db from '../../db.js';
|
||||
import path from 'path';
|
||||
import storageManager from '../data/storageManager.js';
|
||||
const db = require('../../db.js');
|
||||
const path = require('path');
|
||||
const storageManager = require('../data/storageManager.js');
|
||||
|
||||
async function uploadMeasureImage(image, projectId, orderId) {
|
||||
try {
|
||||
@@ -114,7 +114,7 @@ async function getPathList(IdList, projectId) {
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
module.exports = {
|
||||
uploadMeasureImage,
|
||||
addMeasureToProject,
|
||||
getNextOrderId,
|
||||
@@ -127,4 +127,4 @@ export {
|
||||
updateMeasurementById,
|
||||
getPathFromIds,
|
||||
getPathList
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import storageManager from '../data/storageManager.js';
|
||||
import db from '../../db.js';
|
||||
const storageManager = require('../data/storageManager.js');
|
||||
const db = require('../../db.js');
|
||||
|
||||
function createProjectDirectory(projectId) {
|
||||
const projectPath = `${projectId}`;
|
||||
@@ -69,7 +69,7 @@ async function getMeasurementsByProjectId(projectId) {
|
||||
return res.rows;
|
||||
}
|
||||
|
||||
export {
|
||||
module.exports = {
|
||||
createProjectDirectory,
|
||||
deleteProjectDirectory,
|
||||
getAllProjects,
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
const { exec } = require('child_process');
|
||||
const util = require('util');
|
||||
const execPromise = util.promisify(exec);
|
||||
const { spawn } = require('child_process');
|
||||
let globalProgress = {};
|
||||
|
||||
const serverError = require('../../utils/serverError');
|
||||
const db = require('../../db');
|
||||
const storageManager = require('../data/storageManager');
|
||||
const measureManager = require('../measure/measureManager');
|
||||
|
||||
const PROJECTS_DIR = path.join('.');
|
||||
|
||||
@@ -31,9 +25,9 @@ async function deleteUnfinishedVideos() {
|
||||
}
|
||||
}
|
||||
|
||||
async function cleanVideoFiles() {
|
||||
//supprimer les fichiers vidéos qui ne sont pas associés à une vidéo de la base de données
|
||||
}
|
||||
// async function cleanVideoFiles() {
|
||||
// //supprimer les fichiers vidéos qui ne sont pas associés à une vidéo de la base de données
|
||||
// }
|
||||
|
||||
deleteUnfinishedVideos();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user