Closed fgraux closed 4 years ago
const grandiose = require('grandiose'); let ndiList = await grandiose.find();
Thanks for your quick reply, I tried this
function ndi_detect(z, callback){
const grandiose = require('grandiose');
let ndiList = await grandiose.find();
IOSendData(['web'], 'ndilist', ndiList);
callback(undefined, "\n"+dateTimeNow()+"\t^#^B^W \t ^ \tList Loaded: oui!\t ^ \t"+ndiList)
}
and it caused the app crashing.
hello I made up a new install of grandiose on an other computer, set up a simple js file:
const grandiose = require('grandiose');
let ndiList = await grandiose.find();
still same issue : the app crashes. If I suppr 'await', the app remains open but nothing come. Please can you help me ?
I change my precedent function while adding async:
async function ndi_detect(z, callback){
const grandiose = require('grandiose');
let ndiList = await grandiose.find();
IOSendData(['web'], 'ndilist', ndiList);
callback(undefined, "\n"+dateTimeNow()+"\t^#^B^W \t ^ \tList Loaded: oui!\t ^ \t"+ndiList)
}
It doesnt crash anymore, now I have a return, but instead of the expected [ {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''} ] it return: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I change my precedent function while adding async:
async function ndi_detect(z, callback){
const grandiose = require('grandiose');
let ndiList = await grandiose.find();
IOSendData(['web'], 'ndilist', ndiList);
callback(undefined, "\n"+dateTimeNow()+"\t^#^B^W \t ^ \tList Loaded: oui!\t ^ \t"+ndiList)
}
It doesnt crash anymore, now I have a return, but instead of the expected [ {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''}, {name: '', urlAddress: ''} ] it return: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Just added a ndiList = JSON.stringify(ndiList ); and everything is now working (SO) well !!! Sorry and thanks
Hi there your module seems to be great, but at this time after several days of trying, I'm still unable to put the array result into a var (ndiList) to send it to my html casparcg client. The only thing I succeed is to display it in the console (pretty sad, no ?). Here is my code with a promise to wait for the answer to come before sending it... Would you please help me ?
function ndi_detect(z, callback){
const jeanpierre = require('grandiose'); var ndiV = jeanpierre.version(); const ndi = jeanpierre.find({ showLocalSources: false, extraIPs: [ z ] }); var ndiList;
}