Upload refactor #242
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"WalletConfig": {
|
||||
"LbryClaimAddress": null,
|
||||
"LbryChangeAddress": null,
|
||||
"DefaultChannel": null
|
||||
},
|
||||
"AnalyticsConfig":{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"WalletConfig": {
|
||||
"DefaultChannel": "@speechDev",
|
||||
"LbryChangeAddress": "bPsZ4wmrNUsn7gMP9cZ9G6RjM5RpuJAeTt"
|
||||
},
|
||||
"AnalyticsConfig":{
|
||||
"GoogleId": "UA-100747990-1"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"WalletConfig": {
|
||||
"DefaultChannel": "@speech",
|
||||
"LbryChangeAddress": null
|
||||
},
|
||||
"AnalyticsConfig":{
|
||||
"GoogleId": "UA-60403362-3"
|
||||
|
|
|
@ -67,7 +67,6 @@ module.exports = {
|
|||
resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;
|
||||
})
|
||||
.catch(error => {
|
||||
logger.error('publishController.publish error', error);
|
||||
publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file
|
||||
reject(error);
|
||||
});
|
||||
|
|
|
@ -135,8 +135,7 @@ module.exports = {
|
|||
license,
|
||||
nsfw,
|
||||
},
|
||||
claim_address : config.get('WalletConfig.LbryClaimAddress'),
|
||||
change_address: config.get('WalletConfig.LbryChangeAddress'),
|
||||
claim_address: config.get('WalletConfig.LbryClaimAddress'),
|
||||
};
|
||||
// add thumbnail to channel if video
|
||||
if (thumbnail !== null) {
|
||||
|
|
|
@ -123,29 +123,28 @@ var publishFileFunctions = {
|
|||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
var uri = "/api/publish";
|
||||
var xhr = new XMLHttpRequest();
|
||||
var fd = this.appendDataToFormData(file, metadata);
|
||||
console.log('fd2:', fd);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
xhr.upload.addEventListener("loadstart", function(e) {
|
||||
uploadStarted();
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showUploadStartedMessage();
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
})
|
||||
xhr.upload.addEventListener("progress", function(e) {
|
||||
if (e.lengthComputable) {
|
||||
var percentage = Math.round((e.loaded * 100) / e.total);
|
||||
console.log('progress:', percentage);
|
||||
uploadProgress(percentage);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showUploadProgressMessage(percentage);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
}
|
||||
}, false);
|
||||
xhr.upload.addEventListener("load", function(e){
|
||||
console.log('loaded 100%');
|
||||
filePublishUpdate("Your file has been loaded, and is now being published to the blockchain. Sit tight...")
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showFilePublishUpdate("Your file has been loaded, and is now being published to the blockchain. Sit tight...")
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
}, false);
|
||||
xhr.open("POST", uri, true);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
alert(xhr.responseText); // handle response.
|
||||
filePublishComplete(xhr.responseText);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showFilePublishComplete(xhr.responseText);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
} else {
|
||||
filePublishFailure(xhr.responseText);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showFilePublishFailure(xhr.responseText);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
}
|
||||
} else {
|
||||
console.log('xhr.readyState', xhr.readyState, 'xhr.status', xhr.status);
|
||||
|
@ -184,7 +183,7 @@ var publishFileFunctions = {
|
|||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
},
|
||||
}
|
||||
|
||||
function uploadStarted (){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
function showUploadStartedMessage (){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
console.log('starting upload');
|
||||
// hide the publish tool
|
||||
hidePublishTools();
|
||||
|
@ -192,27 +191,27 @@ function uploadStarted (){
|
|||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
showPublishStatus();
|
||||
showPublishProgressBar();
|
||||
};
|
||||
function uploadProgress (percentage){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
function showUploadProgressMessage (percentage){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
updatePublishStatus('<p>File is loading to server</p>')
|
||||
updateUploadPercent(`<p class="blue">${percentage}%</p>`)
|
||||
};
|
||||
function filePublishUpdate (msg) {
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
function showFilePublishUpdate (msg) {
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
updatePublishStatus(`<p>${msg}</p>`);
|
||||
updateUploadPercent(`<p>Curious what magic is happening here? <a class="link--primary" target="blank" href="https://lbry.io/faq/what-is-lbry">Learn more.</a></p>`);
|
||||
};
|
||||
function filePublishFailure (msg){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
function showFilePublishFailure (msg){
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
updatePublishStatus('<p> --(✖╭╮✖)→ </p><p>' + JSON.stringify(msg) + '</p><strong>For help, post the above error text in the #speech channel on the <a class="link--primary" href="https://discord.gg/YjYbwhS" target="_blank">lbry discord</a></strong>');
|
||||
hidePublishProgressBar();
|
||||
hideUploadPercent();
|
||||
};
|
||||
function filePublishComplete (msg) {
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
console.log('filePublishComplete message:', msg);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
function showFilePublishComplete (msg) {
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
console.log('Publish complete! message:', msg);
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
const showUrl = msg.result.claim_id + "/" + msg.name;
|
||||
// update status
|
||||
updatePublishStatus('<p>Your publish is complete! You are being redirected to it now.</p>');
|
||||
updateUploadPercent('<p><a class="link--primary" target="_blank" href="\' + showUrl + \'">If you do not get redirected, click here.</a></p>')
|
||||
// redirect the user
|
||||
window.location.href = showUrl;
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
// window.location.href = showUrl;
|
||||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
||||
};
|
||||
|
||||
function hidePublishTools() {
|
||||
|
|
|||
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
Presumably Presumably `const`
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage. Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.
|
|
@ -1,4 +1,4 @@
|
|||
<div class="row">
|
||||
<div class="row row--padded">
|
||||
<h3>404: Not Found</h3>
|
||||
<p>That page does not exist. Return <a class="link--primary" href="/">home</a>.</p>
|
||||
</div>
|
||||
|
|
|
@ -50,7 +50,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script typ="text/javascript">
|
||||
|
||||
</script>
|
||||
|
|
Presumably
const
Late on catching this one, but this function name doesn't imply it is redirecting me to the homepage.