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

View file

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

View file

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