Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static getDB(startup = false) {
var settings = require('./settings').get();
if(!settings) {
logger.info("No settings file found, can't initialize DB");
return null;
}
if (!settings.activeProfile || !settings.activeProfile.characterName) {
logger.info("No active profile selected, can't initialize DB");
return null;
}
var app = require('electron').app || require('electron').remote.app;
var db = new sqlite3.cached.Database(path.join(app.getPath("userData"), settings.activeProfile.characterName + ".db"));
if(startup) {
logger.info(`Initializing database for ${settings.activeProfile.characterName}`);
this.init(db);
}
return db;
}
function(callback)
{
_this.db = new sqlite3.cached.Database(_this.settings.filename, callback);
},
function(callback)
FilterAppHsp.prototype.start = function(callback) {
if (this.sqlite_db) {
sqlite = new sqlite3.cached.Database(this.sqlite_db);
logger.info('Initializing App HSP SQLITE:',this.sqlite_db);
}
if (this.strip_local) {
this.strip_local = new RegExp(this.strip_local);
logger.info('Initializing App HSP RegExp:',this.strip_local);
}
if (this.strip_dialprefix) {
this.strip_dialprefix = new RegExp(this.strip_dialprefix);
logger.info('Initializing App HSP RegExp:',this.strip_dialprefix);
}
if (this.strip_testuser) {
this.strip_testuser = new RegExp(this.strip_testuser);
logger.info('Initializing App HSP RegExp:',this.strip_testuser);
}
if (this.hepic_token){