updated claim-name verification process
This commit is contained in:
parent
2a9aad3b56
commit
53b8fb9766
5 changed files with 63 additions and 72 deletions
|
@ -18,21 +18,6 @@ function handleResponse ({ data }, resolve, reject) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
getWalletList () {
|
|
||||||
logger.debug('lbryApi >> getting wallet list');
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
axios
|
|
||||||
.post('http://localhost:5279/lbryapi', {
|
|
||||||
method: 'wallet_list',
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
handleResponse(response, resolve, reject);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
publishClaim (publishParams) {
|
publishClaim (publishParams) {
|
||||||
logger.debug(`lbryApi >> Publishing claim to "${publishParams.name}"`);
|
logger.debug(`lbryApi >> Publishing claim to "${publishParams.name}"`);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
|
@ -2,7 +2,6 @@ const logger = require('winston');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const db = require('../models');
|
const db = require('../models');
|
||||||
const { getWalletList } = require('./lbryApi.js');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
validateFile (file, name, license, nsfw) {
|
validateFile (file, name, license, nsfw) {
|
||||||
|
@ -113,21 +112,17 @@ module.exports = {
|
||||||
db.File.findAll({ where: { name } })
|
db.File.findAll({ where: { name } })
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result.length >= 1) {
|
if (result.length >= 1) {
|
||||||
// filter out any results that were not published from a spee.ch wallet address
|
const claimAddress = config.get('WalletConfig.LbryClaimAddress');
|
||||||
getWalletList()
|
// filter out any results that were not published from spee.ch's wallet address
|
||||||
.then((walletList) => {
|
|
||||||
const filteredResult = result.filter((claim) => {
|
const filteredResult = result.filter((claim) => {
|
||||||
return walletList.includes(claim.address);
|
return (claim.address === claimAddress);
|
||||||
});
|
});
|
||||||
|
// return based on whether any non-spee.ch claims were left
|
||||||
if (filteredResult.length >= 1) {
|
if (filteredResult.length >= 1) {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
} else {
|
} else {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,9 +79,13 @@ footer {
|
||||||
}
|
}
|
||||||
|
|
||||||
.row--wide {
|
.row--wide {
|
||||||
padding: 1em 0px 1em 0px;
|
padding-right: 0px;
|
||||||
margin: 0px;
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row--thin {
|
||||||
|
padding-top: 0.5em;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-bar {
|
.top-bar {
|
||||||
|
@ -217,6 +221,13 @@ input:-webkit-autofill {
|
||||||
border-bottom: 1px solid grey;
|
border-bottom: 1px solid grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input-checkbox, .input-textarea {
|
||||||
|
border: 1px solid grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label--secondary {
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
/* BUTTONS */
|
/* BUTTONS */
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
|
|
@ -38,22 +38,6 @@
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#claim-name-input-area {
|
|
||||||
border-bottom: 1px blue solid;
|
|
||||||
float: left;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.publish-input, #publish-license {
|
|
||||||
border: 1px solid lightgrey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.publish-input {
|
|
||||||
padding: 1%;
|
|
||||||
width: 90%
|
|
||||||
}
|
|
||||||
|
|
||||||
/* show routes */
|
/* show routes */
|
||||||
.show-asset {
|
.show-asset {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -7,31 +7,47 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" id="details-detail" hidden="true">
|
<div id="details-detail" hidden="true">
|
||||||
|
|
||||||
<table>
|
<div class="row row--thin">
|
||||||
<tr>
|
<div class="column column--3">
|
||||||
<td><label for="publish-title">Title: </label></td>
|
<label for="publish-title" class="label label--secondary">Title: </label>
|
||||||
<td><input type="text" id="publish-title" class="input-text input-text--primary"></td>
|
</div>
|
||||||
</tr>
|
<div class="column column--9">
|
||||||
<tr>
|
<input type="text" id="publish-title" class="input-text input-text--primary">
|
||||||
<td><label for="publish-description">Description: </label></td>
|
</div>
|
||||||
<td><textarea rows="2" id="publish-description" class="textarea textarea--primary"> </textarea></td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
<div class="row row--thin">
|
||||||
<td><label for="publish-license">License:* </label></td>
|
<div class="column column--3">
|
||||||
<td>
|
<label for="publish-description" class="label label--secondary">Description: </label>
|
||||||
<select type="text" id="publish-license" name="license" value="license">
|
</div>
|
||||||
|
<div class="column column--9">
|
||||||
|
<textarea rows="2" id="publish-description" class="input-textarea"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row row--thin">
|
||||||
|
<div class="column column--3">
|
||||||
|
<label for="publish-license" class="label label--secondary">License:* </label>
|
||||||
|
</div>
|
||||||
|
<div class="column column--9">
|
||||||
|
<select type="text" id="publish-license" class="select select--primary">
|
||||||
<option value="Public Domain">Public Domain</option>
|
<option value="Public Domain">Public Domain</option>
|
||||||
<option value="Creative Commons">Creative Commons</option>
|
<option value="Creative Commons">Creative Commons</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
|
||||||
<td><label for="publish-nsfw">NSFW*</label></td>
|
<div class="row row--thin">
|
||||||
<td><input type="checkbox" id="publish-nsfw"></td>
|
<div class="column column--3">
|
||||||
</tr>
|
<label for="publish-nsfw" class="label label--secondary">NSFW*</label>
|
||||||
</table>
|
</div>
|
||||||
|
<div class="column column--9">
|
||||||
|
<input class="input-checkbox" type="checkbox" id="publish-nsfw">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue