lbryio / lbry-first

One stop shop for uploading digital content to alternatives to empower LBRY First!
MIT License
4 stars 1 forks source link

Track upload progress / failures #5

Closed tzarebczan closed 4 years ago

tzarebczan commented 4 years ago

Some users have reported failures to upload to youtube, but nothing is shown in app

tiger5226 commented 4 years ago
if (filePath) publishPayload.file_path = filePath;
  return Lbry.publish(publishPayload)
    .then((response) => {
      if (!useLBRYUploader) {
        return success(response);
      }
      return LbryFirst.upload(publishPayload).then(success(response), success(response));
    }, fail);

Currently what we are doing appside to get this connected to the publish workflow, is on a successful publish to lbry, we execute the lbry-first logic. The return currently always returns the success response of the lbry publish function:

return LbryFirst.upload(publishPayload).then(success(response), success(response));

@seanyesmunt please confirm, but if I just instead change it to:

return LbryFirst.upload(publishPayload).then( (r) => {success(r), fail(r)});

This would then push the error response from the upload function to the UI right?

neb-b commented 4 years ago

A couple ways you could do this:

return LbryFirst.upload(publishPayload).then(success, fail);
  return Lbry.publish(publishPayload)
    .then((response) => {
      if (!useLBRYUploader) {
        return success(response);
      }
      return LbryFirst.upload(publishPayload).then(success));
    }).catch(fail);
tiger5226 commented 4 years ago

Thanks @seanyesmunt , added the first in.

tzarebczan commented 4 years ago

Let's say the upload to youtube fails (for whatever reason - bandwidth, etc) - there would be no easy way to re-try it right? We don't re-upload on edits. Eventually we can give an option in the UI to reupload the file - we'd probably want to make them reselect it so it uploads the original file (vs using the file list file).