Upload refactor #242

Merged
bones7242 merged 24 commits from upload-refactor into master 2017-11-13 21:39:21 +01:00
8 changed files with 14 additions and 24 deletions
Showing only changes of commit c658f67ec4 - Show all commits

View file

@ -1,7 +1,6 @@
{ {
"WalletConfig": { "WalletConfig": {
"LbryClaimAddress": null, "LbryClaimAddress": null,
"LbryChangeAddress": null,
"DefaultChannel": null "DefaultChannel": null
}, },
"AnalyticsConfig":{ "AnalyticsConfig":{

View file

@ -1,7 +1,6 @@
{ {
"WalletConfig": { "WalletConfig": {
"DefaultChannel": "@speechDev", "DefaultChannel": "@speechDev",
"LbryChangeAddress": "bPsZ4wmrNUsn7gMP9cZ9G6RjM5RpuJAeTt"
}, },
"AnalyticsConfig":{ "AnalyticsConfig":{
"GoogleId": "UA-100747990-1" "GoogleId": "UA-100747990-1"

View file

@ -1,7 +1,6 @@
{ {
"WalletConfig": { "WalletConfig": {
"DefaultChannel": "@speech", "DefaultChannel": "@speech",
"LbryChangeAddress": null
}, },
"AnalyticsConfig":{ "AnalyticsConfig":{
"GoogleId": "UA-60403362-3" "GoogleId": "UA-60403362-3"

View file

@ -67,7 +67,6 @@ module.exports = {
resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim; resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;
}) })
.catch(error => { .catch(error => {
logger.error('publishController.publish error', error);
publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file
reject(error); reject(error);
}); });

View file

@ -135,8 +135,7 @@ module.exports = {
license, license,
nsfw, nsfw,
}, },
claim_address : config.get('WalletConfig.LbryClaimAddress'), claim_address: config.get('WalletConfig.LbryClaimAddress'),
change_address: config.get('WalletConfig.LbryChangeAddress'),
}; };
// add thumbnail to channel if video // add thumbnail to channel if video
if (thumbnail !== null) { if (thumbnail !== null) {

View file

@ -123,29 +123,28 @@ var publishFileFunctions = {
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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 uri = "/api/publish";
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var fd = this.appendDataToFormData(file, metadata); var fd = this.appendDataToFormData(file, metadata);
console.log('fd2:', fd);
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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) { xhr.upload.addEventListener("loadstart", function(e) {
uploadStarted(); showUploadStartedMessage();
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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) { xhr.upload.addEventListener("progress", function(e) {
if (e.lengthComputable) { if (e.lengthComputable) {
var percentage = Math.round((e.loaded * 100) / e.total); var percentage = Math.round((e.loaded * 100) / e.total);
console.log('progress:', percentage); console.log('progress:', percentage);
uploadProgress(percentage); showUploadProgressMessage(percentage);
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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); }, false);
xhr.upload.addEventListener("load", function(e){ xhr.upload.addEventListener("load", function(e){
console.log('loaded 100%'); console.log('loaded 100%');
filePublishUpdate("Your file has been loaded, and is now being published to the blockchain. Sit tight...") showFilePublishUpdate("Your file has been loaded, and is now being published to the blockchain. Sit tight...")
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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); }, false);
xhr.open("POST", uri, true); xhr.open("POST", uri, true);
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (xhr.readyState == 4) { if (xhr.readyState == 4) {
if (xhr.status == 200) { if (xhr.status == 200) {
alert(xhr.responseText); // handle response. alert(xhr.responseText); // handle response.
filePublishComplete(xhr.responseText); showFilePublishComplete(xhr.responseText);
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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 { } else {
filePublishFailure(xhr.responseText); showFilePublishFailure(xhr.responseText);
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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 { } else {
console.log('xhr.readyState', xhr.readyState, 'xhr.status', xhr.status); console.log('xhr.readyState', xhr.readyState, 'xhr.status', xhr.status);
@ -184,7 +183,7 @@ var publishFileFunctions = {
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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 (){ function showUploadStartedMessage (){
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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'); console.log('starting upload');
// hide the publish tool // hide the publish tool
hidePublishTools(); hidePublishTools();
@ -192,27 +191,27 @@ function uploadStarted (){
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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(); showPublishStatus();
showPublishProgressBar(); showPublishProgressBar();
}; };
function uploadProgress (percentage){ function showUploadProgressMessage (percentage){
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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>') updatePublishStatus('<p>File is loading to server</p>')
updateUploadPercent(`<p class="blue">${percentage}%</p>`) updateUploadPercent(`<p class="blue">${percentage}%</p>`)
}; };
function filePublishUpdate (msg) { function showFilePublishUpdate (msg) {
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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>`); 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>`); 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){ function showFilePublishFailure (msg){
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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>'); 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(); hidePublishProgressBar();
hideUploadPercent(); hideUploadPercent();
}; };
function filePublishComplete (msg) { function showFilePublishComplete (msg) {
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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); console.log('Publish complete! message:', msg);
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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; const showUrl = msg.result.claim_id + "/" + msg.name;
// update status // update status
updatePublishStatus('<p>Your publish is complete! You are being redirected to it now.</p>'); 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>') updateUploadPercent('<p><a class="link--primary" target="_blank" href="\' + showUrl + \'">If you do not get redirected, click here.</a></p>')
// redirect the user // redirect the user
window.location.href = showUrl; // window.location.href = showUrl;
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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() { function hidePublishTools() {

kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.
kauffj commented 2017-11-10 18:33:00 +01:00 (Migrated from github.com)
Review

Presumably const

Presumably `const`
kauffj commented 2017-11-10 18:33:35 +01:00 (Migrated from github.com)
Review

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.

View file

@ -1,4 +1,4 @@
<div class="row"> <div class="row row--padded">
<h3>404: Not Found</h3> <h3>404: Not Found</h3>
<p>That page does not exist. Return <a class="link--primary" href="/">home</a>.</p> <p>That page does not exist. Return <a class="link--primary" href="/">home</a>.</p>
</div> </div>

View file

@ -50,7 +50,3 @@
</div> </div>
</div> </div>
</div> </div>
<script typ="text/javascript">
</script>