Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// fix framenumber, insert it and decrease i again
// so it loops through it again to check
// if first frame missing fill it with default object
let correctedDuplicate;
if (i === 0) {
correctedDuplicate = Object.assign({}, {
frameNumber: 0,
meanColor: "[0,0,0]",
differenceValue: 0,
});
} else {
correctedDuplicate = Object.assign({}, arrayOfFrameScanData[i-1]);
correctedDuplicate.frameNumber = i;
}
log.info(`repaired frameScanData at: ${i}`);
arrayOfFrameScanData.splice(i, 0, correctedDuplicate);
i -= 1;
}
}
// no return is needed as arrayOfFrameScanData gets repaired in place
}
hours: hours,
spent_on: moment.unix(entry.endTime).format('YYYY-MM-DD'),
comments: entry.description,
activity_id: entry.activity
};
const { error, response } = await this.request('POST', `/issues/${entry.issue}/time_entries?format=json`, { time_entry: timeEntry });
if (error || this.constructor.invalidResponse(response, [201])) {
log.info('[Redmine] [Entry] Invalid response:');
log.info(`[Redmine] [Entry] ${JSON.stringify(error)}`);
return Promise.reject(error || 'Invalid response!');
}
log.info('[Redmine] [Entry] Valid response:');
log.info(`[Redmine] [Entry] ${JSON.stringify(response.json)}`);
const data = response.json.get('time_entry');
return Promise.resolve(parseInt(data.get('id'), 10));
}
async function findDL() {
const dlPath = await getPath();
let files = klawSync(dlPath.path, {nodir: true});
_.each(files, (elem, index) => {
files[index] = elem.path;
});
files = _.filter(files, isPlayable);
files.sort();
if (files.length === 0) {
document.getElementById('Loading').style.display = 'none';
const elem = document.getElementById('media');
const emptyElem = document.createElement('h1');
emptyElem.className = 'title';
log.info('VIEWER: No files');
emptyElem.innerText = `You have not downloaded anything yet.`;
const emptySubtitle = document.createElement('h2');
emptyElem.style['text-align'] = 'center';
emptySubtitle.innerText = `Go to the downloader first and do some downloading!`;
emptySubtitle.className = 'subtitle';
emptyElem.appendChild(emptySubtitle);
elem.appendChild(emptyElem);
}
const mediadiv = document.getElementById('media');
const videodiv = document.getElementById('video');
for (let i = 0; i < files.length; i++) {
const parsedName = parser(files[i].replace(/^.*[\\/]/, ''));
if (parsedName !== null) {
const figelem = document.createElement('figure');
const figcap = document.createElement('figcaption');
const imgelem = document.createElement('div');
event => {
let value = { scene: event.detail.loaderRootNode }
log.info('cache: success', filepath)
dispatch({ type: 'ATTACHMENTS_SUCCESS', payload: { id: filepath, value } })
},
null,
if (node.implementation === 'LND') {
const lnd = node as LndNode;
const backend = bitcoin.find(n => n.name === lnd.backendName) || bitcoin[0];
file.addLnd(lnd, backend);
}
if (node.implementation === 'c-lightning') {
const cln = node as CLightningNode;
const backend = bitcoin.find(n => n.name === cln.backendName) || bitcoin[0];
file.addClightning(cln, backend);
}
});
const yml = yaml.dump(file.content);
const path = join(network.path, 'docker-compose.yml');
await write(path, yml);
info(`saved compose file for '${network.name}' at '${path}'`);
}
const handleLagecyConfigFile = () => {
if (fs.existsSync(lagecyConfigFile)) {
const newPath = path.join(configFolder, 'cfg.json')
fs.renameSync(lagecyConfigFile, newPath)
log.info(util.format('Renamed lagecy config file %s to %s', lagecyConfigFile, newPath))
}
}
handleLagecyConfigFile()
log.info("main window is created");
let pageUrl;
for (const arg of process.argv.slice(1)) {
if (arg.includes('://')) {
pageUrl = arg;
break;
}
}
if (pageUrl === undefined) {
pageUrl = url.format({
pathname: path.join(__dirname, '../build/'),
protocol: 'file',
});
}
log.info('loading URL ' + pageUrl);
mainWindow.loadURL(pageUrl);
if (process.argv.includes('--dev-tools')) {
mainWindow.webContents.openDevTools();
}
mainWindow.on('closed', () => {
mainWindow = null;
log.info("main windows is closed.")
log.info("=================================================")
});
log.info('Exit CreateWindow()');
}
function sendStatusToWindow(text) {
log.info(text);
windows[ExileWindowEnum.Main].webContents.send('message', text);
}
this.regions = function (callback) {
var countries = [];
log.info("Fetching storefronts...");
//Load local JSON with iTunes storefronts
fs.readFile(__dirname + "/../config/storefronts.json", function (
error,
response
) {
if (error) {
log.error(error);
ToastService.errorToast("Couldn't load storefronts.");
} else {
JSON.parse(response).data.forEach(function (obj) {
countries.push({ iso: obj.id, name: obj.attributes.name });
});
log.info("Done fetching storefronts.");
}
callback(countries);
});
'--force-temp'
];
info.waitPids.forEach((pid) => {
updaterArgs.push('-p');
updaterArgs.push(pid);
});
if (statusWindow) {
updaterArgs.push('-p');
updaterArgs.push(statusWindow.webContents.getOSProcessId().toString());
}
const updaterStartCommand = `start \"\" \"${updaterPath}\" `
log.info(updaterArgs);
const update_spawned = cp.spawn(`${updaterStartCommand}`, updaterArgs, {
cwd: info.tempDir,
detached: true,
shell: true
});
log.info('updater process ' + `pid ${update_spawned.pid}`);
const returnCode = await new Promise(resolve => {
update_spawned.on('exit', resolve);
update_spawned.on('error', resolve);
})
log.info('Updater spawn promise ' + `result \"${returnCode}\"`);