fix(eslint) Run lint-fix

This commit is contained in:
BelfordZ 2017-10-12 20:56:21 -07:00
parent ea000dcfc8
commit eb5c3acf7c
2 changed files with 61 additions and 62 deletions
server
controllers
utils/importer

View file

@ -22,23 +22,23 @@ function getResults (input) {
if (input.size === undefined) input.size = 10; if (input.size === undefined) input.size = 10;
if (input.from === undefined) input.from = 0; if (input.from === undefined) input.from = 0;
return eclient.search({ return eclient.search({
index: "claims", index : 'claims',
_source: ["name", "value", "claimId"], _source: ['name', 'value', 'claimId'],
body: { body : {
"query": { 'query': {
"bool": { 'bool': {
"must": { 'must': {
"query_string": { 'query_string': {
"query": '*' + input.s.trim() + '*', 'query' : '*' + input.s.trim() + '*',
"fields": [ 'fields': [
"name", 'name',
"value.stream.metadata.author", 'value.stream.metadata.author',
"value.stream.metadata.title", 'value.stream.metadata.title',
"value.stream.metadata.description" 'value.stream.metadata.description',
] ],
} },
} },
} },
}, },
size: input.size, size: input.size,
from: input.from, from: input.from,
@ -50,22 +50,22 @@ function getAutoComplete (input) {
if (input.size === undefined) input.size = 10; if (input.size === undefined) input.size = 10;
if (input.from === undefined) input.from = 0; if (input.from === undefined) input.from = 0;
return eclient.search({ return eclient.search({
index: "claims", index : 'claims',
_source: ["name", "value.stream.metadata.title", "value.stream.metadata.author"], _source: ['name', 'value.stream.metadata.title', 'value.stream.metadata.author'],
body: { body : {
"query": { 'query': {
"bool": { 'bool': {
"must": { 'must': {
"query_string": { 'query_string': {
"query": "*" + input.s.trim() + "*", 'query' : '*' + input.s.trim() + '*',
"fields": [ 'fields': [
"name", 'name',
"value.stream.metadata.title", 'value.stream.metadata.title',
"value.stream.metadata.author" 'value.stream.metadata.author',
] ],
} },
} },
} },
}, },
size: input.size, size: input.size,
from: input.from, from: input.from,

View file

@ -27,41 +27,40 @@ const eclient = new elasticsearch.Client({
}); });
const queue = new ElasticQueue({elastic: eclient}); const queue = new ElasticQueue({elastic: eclient});
//Get the lbrycrd config from the .lbrycrd folder. // Get the lbrycrd config from the .lbrycrd folder.
function getClient () { function getClient () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fileExists(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf'), (err, exists) => { fileExists(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf'), (err, exists) => {
if (err) { reject(err) }; if (err) { reject(err) };
let config = {'username': 'lbry', 'password': 'lbry', 'rpc_port': 9245}; let config = {'username': 'lbry', 'password': 'lbry', 'rpc_port': 9245};
if (exists) { if (exists) {
let prop = PropertiesReader(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf')); let prop = PropertiesReader(path.join(os.homedir(), '.lbrycrd/lbrycrd.conf'));
config.username = prop.get('rpcuser'); config.username = prop.get('rpcuser');
config.password = prop.get('rpcpassword'); config.password = prop.get('rpcpassword');
config.rpc_port = prop.get('rpcport'); config.rpc_port = prop.get('rpcport');
let client = new bitcoin.Client({ let client = new bitcoin.Client({
host : 'localhost', host : 'localhost',
port : config.rpc_port, port : config.rpc_port,
user : config.username, user : config.username,
pass : config.password, pass : config.password,
timeout: 30000, timeout: 30000,
});
resolve(client);
} else {
let client = new bitcoin.Client({
host : 'localhost',
port : config.rpc_port,
user : config.username,
pass : config.password,
timeout: 30000,
});
resolve(client);
}
}); });
resolve(client);
} else {
let client = new bitcoin.Client({
host : 'localhost',
port : config.rpc_port,
user : config.username,
pass : config.password,
timeout: 30000,
});
resolve(client);
}
});
}); });
} }
// Check that our cache file exist.
//Check that our cache file exist.
fileExists(path.join(appRoot.path, 'claimTrieCache.json'), (err, exists) => { fileExists(path.join(appRoot.path, 'claimTrieCache.json'), (err, exists) => {
if (err) { throw err }; if (err) { throw err };
if (!exists) { if (!exists) {