- corretto footer catalogo

- corretti il path delle immagini (quando hanno lo spazio nel nomefile).
- aggiunto colore di sfondo per il testo descrittivo, in trasparenza
This commit is contained in:
Surya Paolo
2025-05-21 12:06:15 +02:00
parent 10097f4238
commit d6aaaabb00
6 changed files with 18 additions and 18 deletions

View File

@@ -73,6 +73,7 @@ const CatalogSchema = new Schema({
pagina_introduttiva_sfondo_nero: { pagina_introduttiva_sfondo_nero: {
type: Boolean, type: Boolean,
}, },
backcolor: String,
pdf_generato: String, pdf_generato: String,
pdf_generato_stampa: String, pdf_generato_stampa: String,

View File

@@ -49,7 +49,6 @@ class CronMod {
const AmazonBookScraper = require('../modules/Scraping'); const AmazonBookScraper = require('../modules/Scraping');
let mystr = ""; let mystr = "";
try { try {
@@ -59,8 +58,8 @@ class CronMod {
} else if (mydata.dbop === "ScraperMultipleDataAmazon") { } else if (mydata.dbop === "ScraperMultipleDataAmazon") {
mystr = await AmazonBookScraper.ScraperMultipleDataAmazon(idapp, {update: true, aggiornasoloSeVuoti: true, forzaricarica: false}); mystr = await AmazonBookScraper.ScraperMultipleDataAmazon(idapp, {update: true, aggiornasoloSeVuoti: true, forzaricarica: false});
ris = { mystr }; ris = { mystr };
} else if (mydata.dbop === "ScraperMultipleDataDBStored") { } else if (mydata.dbop === "ScraperEstraiDatiAmazon-NoUpdate") {
mystr = await AmazonBookScraper.ScraperMultipleDataDBStored(idapp, {update: true, aggiornasoloSeVuoti: true, forzaricarica: false, dbstored: true}); mystr = await AmazonBookScraper.ScraperMultipleDataAmazon(idapp, {update: false, aggiornasoloSeVuoti: false, forzaricarica: true, caricatutti: true});
ris = { mystr }; ris = { mystr };
} else if (mydata.dbop === "ScraperGeneraCSV") { } else if (mydata.dbop === "ScraperGeneraCSV") {
mystr = await AmazonBookScraper.ScraperGeneraCSV(idapp, mydata.options, res); mystr = await AmazonBookScraper.ScraperGeneraCSV(idapp, mydata.options, res);

View File

@@ -474,7 +474,7 @@ class AmazonBookScraper {
let isbn = product.isbn; let isbn = product.isbn;
if (this.includiNelControlloIlRecProduct(product)) { if (this.includiNelControlloIlRecProduct(product)) {
if (this.datiMancanti(product)) { if (this.datiMancanti(product) || options.caricatutti) {
// console.log(`${quanti} / ${products.length} - Scraping: ${product.idProductInfo.name}`); // console.log(`${quanti} / ${products.length} - Scraping: ${product.idProductInfo.name}`);
const data = await this.scrapeISBN(product, isbn, options); const data = await this.scrapeISBN(product, isbn, options);

View File

@@ -2353,6 +2353,7 @@ function uploadFile(req, res, version) {
// Create Dir if doesn't exist: // Create Dir if doesn't exist:
const rismk = await tools.mkdirpath(mydir); const rismk = await tools.mkdirpath(mydir);
let filename = file.originalFilename; let filename = file.originalFilename;
let ext = path.extname(filename); let ext = path.extname(filename);
@@ -2389,7 +2390,8 @@ function uploadFile(req, res, version) {
// allora mi conviene che lo faccio dopo, manualmente. // allora mi conviene che lo faccio dopo, manualmente.
console.log('Dovresti copiare fromfile', fromfile, 'tofile', tofile); console.log('Dovresti copiare fromfile', fromfile, 'tofile', tofile);
console.log('sudo cp -R ' + fromfile + ' ' + tofile); console.log('sudo cp -R \'' + fromfile + '\' \'' + tofile + '\'');
await tools.execScriptNoOutput('sudo cp -R \'' + fromfile + '\' \'' + tofile + '\'');
// await tools.execScriptNoOutput('sudo cp -R ' + fromfile + ' ' + tofile) // await tools.execScriptNoOutput('sudo cp -R ' + fromfile + ' ' + tofile)
res.end(); res.end();
return; return;

View File

@@ -456,7 +456,6 @@ module.exports = {
MYAPPS: [], MYAPPS: [],
INITDB_FIRSTIME: true, INITDB_FIRSTIME: true,
ACAPO: '\n', ACAPO: '\n',
ENABLE_CRONTAB: 'CRONTAB', ENABLE_CRONTAB: 'CRONTAB',
UPDATE_GRADUATORIA: 'UPDATE_GRAD', UPDATE_GRADUATORIA: 'UPDATE_GRAD',
@@ -560,7 +559,6 @@ module.exports = {
return false; return false;
} }
}, },
gettranslate: function (text, lang) { gettranslate: function (text, lang) {
try { try {
@@ -590,7 +588,7 @@ module.exports = {
} }
}, },
getres__: function(text, res) { getres__: function (text, res) {
let lang = this.getlangbyres(res); let lang = this.getlangbyres(res);
try { try {
return textlang[lang][text]; return textlang[lang][text];
@@ -4632,18 +4630,18 @@ module.exports = {
}); });
}); });
}, },
execScriptNoOutput: async function (script) { execScriptNoOutput: function (script) {
return new Promise(async (resolve, reject) => { return new Promise((resolve, reject) => {
console.log('execScriptNoOutput:', script); console.log('execScriptNoOutput:', script);
exec(script, async (error, stdout, stderr) => { exec(script, (error, stdout, stderr) => {
// Aggiunto async qui
if (error) { if (error) {
console.error(`error: ${error}`); console.error(`Exec error: ${error.message}`);
return reject(error);
} }
if (stderr) { if (stderr) {
console.error(`stderr: ${stderr}`); console.warn(`Stderr (non bloccante): ${stderr}`);
} }
resolve(!error && !stderr); resolve(true);
}); });
}); });
}, },
@@ -5908,7 +5906,6 @@ module.exports = {
dirmain = server_constants.DIR_PUBLIC_LOCALE; dirmain = server_constants.DIR_PUBLIC_LOCALE;
} }
/*if (true) { /*if (true) {
const prova = await this.isFileExistsAsync('prova'); const prova = await this.isFileExistsAsync('prova');
console.log('PROVA:', prova); console.log('PROVA:', prova);
@@ -5977,6 +5974,7 @@ module.exports = {
} }
} }
let fileesistente = false; let fileesistente = false;
if (productInfo.imagefile) { if (productInfo.imagefile) {
// controlla se esiste il file // controlla se esiste il file
@@ -6118,5 +6116,5 @@ module.exports = {
} catch { } catch {
return false; return false;
} }
} },
}; };

View File

@@ -1 +1 @@
1.2.48 1.2.49