Notification bug fixes and new upload endpoint switcher on d.tube

in #dtube5 years ago

dtube upload endpoint notif.png

Repository

https://github.com/dtube/dtube

Fixing empty notifications

Pull request: https://github.com/dtube/dtube/pull/104

Whenever a user gets mentioned in both unpromoted and promoted post, or received a vote as Avalon leader node owner, the notification that the user will receive will not render properly. Mentions in promoted posts and leader vote notifications appeared to be blank while notification for mentions in unpromoted posts does not link to any author or video link.

Screenshot 20190718 at 7.34.42 PM.png

This is fixed by adding the missing HTML code in notification.html to render notifications for transaction types 1 and 13. For notifications for transaction type 4 (mentions), the author of the post should be referred to as tx.sender instead of author.

Here is the result:

Before
After

New upload endpoint switcher

Pull request: https://github.com/dtube/dtube/pull/103

This new feature mainly adds the ability to utilize @onelovedtube upload servers on d.tube without the need to leave the website to use the uploader on another domain.

Screenshot 20190718 at 9.15.44 PM.png

A dropdown menu has been added above the video dropzone. Currently, it has 2 options, which are the default cluster.d.tube and uploader.oneloved.tube. If nothing is done to the dropdown menu, the video will be uploaded to the default upload server as usual. If uploader.oneloved.tube gets selected, a few things happen:

  1. If the user is logged in with Steem, /login GET API call is attempted to obtain the encrypted memo, to be decrypted using posting key.
  2. Provided that the logged in Steem account is in the whitelist, encrypted memo is returned then decrypted using the private posting key. The resulting string is sent back to server with /logincb POST API call to obtain the access token.
  3. The returned access_token is then used to authenticate all upload requests, including video, thumbnail and subtitle uploads.

If everything went well, a checkmark will appear on the dropdown box, and all upload calls will be made to the selected upload server instead of the default. If there are any errors, it will fall back to the default upload endpoint (it will return to the unselected state).

Kapture 20190718 at 21.27.57.gif

More details of how the auth system works can be found here.

New upload endpoints may be easily added to the list by updating the thirdPartyUploadEndpoints array in settings.js. Some minor code changes may be needed depending on the backend code that is in place.

Github account

https://github.com/techcoderx

Sort:  

Thank you for your contribution.

  1. there is a extra '1' at the shuffle function and you might consider using e.g. underscore to avoid re-inventing the wheel.
  2. Session.get('uploadEndpoint') === 'uploader.oneloved.tube' could be extracted as it appears more than once. The endpoint and the corresponding handler could be refactored.
  3. comparing the error message e.g. here is not a good idea. You could use error code instead.
  4. jslint/eslint prefers semi-colons.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @justyy! Keep up the good work!

hey thanks for everything you do for the platform man!

your efforts are appreciated

Hey, @techcoderx!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Thank you for attempting to explain this but to us new people to the platform we still dont really understand. Is there something wrong with the code that connects Dtube to Steem and by selecting "uploader.oneloved.tube" fixes that. Is that what your trying to say in lamens terms? If we dont select anything it will keep giving us the error. Als if we pick "cluster.d.tube" what happens then? I'm sorry but I am pretty new here and they keep making changes so it is hard to keep up. Thanks for your post I kinda understood it but I still don't understand what it means or does.

The whole point of having alternative uploaders is to have redundancy so that if an upload server goes down for any reason, there are still other servers (owned by different people) to upload to. @onelovedtube offers a paid IPFS hosting service that enables users to pin their videos through a Discord bot (for videos uploaded to DTube's servers), or a direct upload through the uploader (uploader.oneloved.tube). Videos pinned to our servers are playable indefinitely (as long as the file is available on the IPFS network).

cluster.d.tube is DTube's endpoint for their official upload servers, which is the default if nothing is selected.

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 63196.13
ETH 3385.94
USDT 1.00
SBD 2.45