Commit graph

275 commits

Author SHA1 Message Date
mayeaux e3791aefdc
Send video bitrate and user bandwidth to Watchman (#7145)
* adding functionality to detect user download speed

* calculating bandwidth speed more intelligently

* saving download speed and updating it every 30s

* all the functionality should be done needs testing

* fix linting

* use a 1mb file for calculating bandwidth

* add optional chaining plugin to babel and get bitrate from texttrack

* allow optional chaining for flow

* ignore flow error

* disable bandwidth checking functionality

* fix flow error
2021-10-06 14:59:33 -04:00
zeppi b44be39252 move file actions from lbry-redux 2021-10-06 10:22:49 -04:00
infinite-persistence de6c6f9bfd
List own comments (#7171)
* Add option to pass in url-search params.

Impetus: allow linked comment ID and setting the discussion tab when clicking on the `ClaimPreview`.

* comment.list: fix typos and renamed variables

- Switch from 'author' to 'creator' to disambiguate between comment author and content author. For comment author, we'll use 'commenter' from now on.
- Corrected 'commenterClaimId' to 'creatorClaimId' (just a typo, no functional change).

* doCommentReset: change param from uri to claimId

This reduces one lookup as clients will always have the claimID ready, but might not have the full URI.

It was using URI previously just to match the other APIs.

* Add doCommentListOwn -- command to fetch own comments

Since the redux slice is set up based on content or channel ID (for Channel Discussion page), re-use the channel ID for the case of "own comments". We always clear each ID when fetching page-0, so no worries of conflict when actually browsing the Channel Discussion page.

* Comment: add option to hide the actions section

* Implement own-comments page

* Use new param to remove sort-pins-first.

comment.List currently always pushes pins to the top to support pagination. This new param removes this behavior.
2021-10-01 08:10:27 -04:00
infinite-persistence c71b90cecf
Fix linked-comment scrolling
I think this the best solution so far, at the expense of a slight delay in scrolling if the network call stalls.

- Added "fetching by ID" state so that we don't need to use the ugly N-retries method.
- `scrollIntoView` doesn't work if the element is already in the viewport, and the `scrollBy` adjustment doesn't take into account the y-position restoration that we perform on certain type of pages. Use `window.scrollTo` instead and taking into account current scroll position.
2021-10-01 15:51:05 +08:00
infinite-persistence 2cebdc3113
Fix wrong 'recsysId' sent due to search-key mismatch
## Issue
.../archives/C02FQBM00Q0/p1633044695010600

## Changes
When querying a search key, it has to be an exact match. This was broken by the insertion of `free_only` in the fetch.

Added a function to generate the options, so that all clients stay in sync.
2021-10-01 10:46:26 +08:00
infinite-persistence 3b47edc3b9
Livestream category improvements (#7115)
*  Remove old method of displaying active livestreams

Completely remove it for now to make the commit deltas clearer.
We'll replace it with the new method at the end.

* Fetch and store active-livestream info in redux

* Tiles can now query active-livestream state from redux instead of getting from parent.

*  ClaimTilesDiscover: revert and cleanup

## Simplify
- Simplify to just `uris` instead of having multiple arrays (`uris`, `modifiedUris`, `prevUris`)
- The `prevUris` is for CLS prevention. With this removal, the CLS issue is back, but we'll handle it differently later.
- Temporarily disable the view-count fetching. Code is left there so that I don't forget.

## Fix
- `shouldPerformSearch` was never true when `prefixUris` is present. Corrected the logic.
- Aside: prefix and pin is so similar in function. Hm ....

* ClaimTilesDiscover: factor out options

## Change
Move the `option` code outside and passed in as a pre-calculated prop.

## Reason
To skip rendering while waiting for `claim_search`, we need to add `React.memo(areEqual)`. However, the flag that determines if we are fetching `claim_search` (fetchingClaimSearchByQuery[]) depends on the derived options as the key.

Instead of calculating `options` twice, we moved it to the props so both sides can use it.

It also makes the component a bit more readable.

The downside is that the prop-passing might not be clear.

* ClaimTilesDiscover: reduce ~17 renders at startup to just 2.

* ClaimTilesDiscover: fill with placeholder while waiting for claim_search

## Issue
Livestream claims are fetched seperately, so they might already exists. While claim_search is running, the list only consists of livestreams (collapsed).

## Fix
Fill up the space with placeholders to prevent layout shift.

* Add 'useFetchViewCount' to handle fetching from lists

This effect also stashes fetched uris, so that we won't re-fetch the same uris during the same instance (e.g. during infinite scroll).

*  ClaimListDiscover: revert and cleanup

## Revert
- Removed the 'finalUris' stuff that was meant to "pause" visual changes when fetching. I think it'll be cleaner to use React.memo to achieve that.

## Alterations
- Added `renderUri` to make it clear which array that this component will render.
- Re-do the way we fetch view counts now that 'finalUris' is gone. Not the best method, but at least correct for now.

* ClaimListDiscover: add prefixUris, similar to ClaimTilesDiscover

This will be initially used to append livestreams at the top.

*  Re-enable active livestream tiles using the new method

* doFetchActiveLivestreams: add interval check

- Added a default minimum of 5 minutes between fetches. Clients can bypass this through `forceFetch` if needed.

* doFetchActiveLivestreams: add option check

We'll need to support different 'orderBy', so adding an "options check" when determining if we just made the same fetch.

* WildWest: limit livestream tiles + add ability to show more

Most likely this behavior will change in the future, so we'll leave `ClaimListDiscover` untouched and handle the logic at the page level.

This solution uses 2 `ClaimListDiscover` -- if the reduced livestream list is visible, it handles the header; else the normal list handles the header.

* Use better tile-count on larger screens.

Used the same method as how the homepage does it.
2021-09-24 10:26:21 -04:00
infinite-persistence f38a15ee0d
Blocklist page: fix perpetual spinner when trying to refresh with no channels
There's nothing to do when you don't have a channel, so hide the button and ensure redux fails gracefully.
2021-09-24 15:04:59 +08:00
infinite-persistence 63fd867757
Fix moderator data misalignment. (#7139)
## Issue
Closes 7121 Missing mod block option (large number of moderated channels?)

## Notes
It was bad to assume `channelSignatures` would be the same length as the promise result -- any failure in signing would cause a misalignment.

For my case, an accidentally-merged channel couldn't be signed due to a missing private key. I think it's the same for Drew.
2021-09-21 10:40:44 -04:00
saltrafael 1c59913e7a
Recommended changes (#7089)
* Fix floating

* Change makeSelectRecommendedContentForUri behavior
2021-09-16 16:00:44 -04:00
infinite-persistence 65902f6d58
Commentron err replacement: fix readability + added link support.
- Hopefully this is easier to understand, and easier to add/remove entries.
- The link support will be needed by the upcoming Appeal process.
2021-09-15 16:02:02 +08:00
infinite-persistence af4ff29b23
Fix: Can't unblock if delegator deleted their channel
## Issue
7003 Can't unblock if delegator deleted their channel

## Changes
- Changed the function parameter from 'creatorId' to 'creatorUri'
    - It got short-circuited because we don't resolve deleted channels. But the client already have the full creator URI (containing the needed 'name' and 'id'), so there is no need to actually look at the resolved list -- just pass the uri like all the other functions.
2021-09-11 21:04:21 +08:00
saltrafael e8d8dfa76b
Playlist fall out fixes (#7032)
* Add snack bar notification

* Fix and improve code

* Better handle paid content on playlists

* Fix menu options that show for unauth users
2021-09-10 13:27:21 -04:00
saltrafael 160d8fe4b8
Make autoplay_next pushPrefs and set default value to autoplay setting (#7051) 2021-09-09 12:53:27 -04:00
infinite-persistence 0c1554e453
Blocklist Page: show the timeout ban duration
- 'humanize-duration' is used because 'moment''s humanizer sucks.
2021-09-03 07:17:57 +08:00
infinite-persistence 663376e970
Block timeout was changed from "hours" to "seconds" in Commentron 2021-09-03 07:17:57 +08:00
infinite-persistence a05ccdd44f
Comment Moderation - time based bans
## Issue
6712 Comment Moderation - time based bans

## Approach
- Consolidated the 3 types of blocking buttons in the comment content menu (i.e. Block, Moderator Block, Admin Block) into 1 regular Block button.
- Show a modal when Block is clicked.
    - Let user choose the blocklist.
    - Let user choose the timeout duration (this PR's impetus).
2021-09-03 07:17:56 +08:00
saltrafael 64cbd4ae8d
Expanded Playback and List controls (#6921)
* Dont show countdown on Lists

* Add Repeat icon

* Add Shuffle icon

* Add Replay Icon

* Add Replay Option to autoplayCountdown

* Add Loop Control for Lists

* Add Shuffle control for Lists

* Improve View List Link and Fetch action

* Add Play Button to List page

* Add Shuffle Play Option on List Page and Menus

* Fix Modal Remove Collection I18n

* CSS: Fix Large list titles

* Fix List playback on Floating Player

* Add Theater Mode to its own class and fix bar text display

* Add Play Next VJS component

* Add Play Next Button

* Add Play Previous VJS Component

* Add Play Previous Button

* Add Autoplay Next Button

* Add separate control for autoplay next in list

* Bump redux

* Update CHANGELOG.md
2021-09-02 16:05:32 -04:00
infinite-persistence ebfd648a88
Fix "linked-comment not found" msg not appearing
## Issue
6914 "Linked comment not found" message is gone

## Notes
Commentron updated the message, so the string comparison failed.
2021-08-30 14:12:12 +08:00
saltrafael 02a39e693b
Handle deleted comments 2021-08-28 20:48:49 +08:00
Franco Montenegro bd92110d1f
Automatically claim initial rewards (new_user & email_verified) when … (#6807)
* Automatically claim initial rewards (new_user & email_verified) when accessing creating channel, edit channel and upload

* Do not try to get initial rewards if already claimed.
2021-08-18 12:34:24 -04:00
infinite-persistence 58773ede91
Reload when auth token mismatch is detected (#6897)
## Tickets
- 5504 Signing out of account causes page to break in other tabs
- 6829 merged accounts - force log out / fail sync when x-auth-token and cookie auth token are different

## Steps to replicate
1. Login to odysee with account-A.
2. Open another tab, and split both tabs on the screen.
3. Logout from the 1st tab. Do not activate (focus) the 2nd tab.
4. On the 1st tab, login with account-B.
5. Activate (focus) the 2nd tab. The wallet would have been merged, and we are still logged in as account-A.

## Approach
Reload when the LBRY API token no longer matches the auth token.
2021-08-18 10:49:09 -04:00
jessopb 5f55603fb2
send recsys powered-by (#6875)
* send recsys powered-by

* update lighthouse call in useLighthouse

* rename select selectors

* update channel search too
2021-08-17 10:03:25 -04:00
infinite-persistence 474da87c11
Commentron: min tip API now uses float again 2021-08-12 14:51:41 +08:00
infinite-persistence e9a2f44899
Commentron: incorporate 'setting.Get' into 'doFetchCreatorSettings'
## General
- `setting.List`: returns full creator settings. Requires signature (i.e. you own the channel)
- `setting.Get`: returns a public subset of the creator settings. No signature required, and it is mainly used by the GUI to determine the constraints of a channel (e.g. comments enabled? min tip requirements? etc.). Does not include private settings like "blocked words list".

`doFetchCreatorSettings` will handle both of these. Clients that uses the stashed results (`settingsByChannelId`) just needs to be aware the result might not contain everything, depending on whether you own the channel or not.

## Misc Related Changes
- Finally fix the reducer for COMMENT_FETCH_SETTINGS_COMPLETED to not purge the data on each call.
- Change `doFetchCreatorSettings` to operate on a single channel instead of multiple. We ended up not using the multple mode anyway, so it was wasteful code trying to batch the promises.
- `commentsDisabledChannelIds` is no longer needed. Previously, this was created just to differentiate between Creator (full) and Channel (subset) settings. It's cleaner to just use one object, so eliminated this.
- Remove unused 'commentingEnabled'.

## Aside
- There are now 2 ways to know if a channel has disabled comments: (1) from `comment.list` and `setting.Get|List`. Both of them updates `settingsByChannelId`, so it'll still be a single place for the GUI to check against.
2021-08-12 14:51:41 +08:00
infinite-persistence 658e9bd1db
Enable min_tip setting 2021-08-12 14:51:40 +08:00
infinite-persistence ff9ca662f2
Option to change commments-server (desktop)
## Issue
> 5459 Add setting for changing your comment server. Visible on desktop (and possibly defaulting to Odysee URL), hidden on odysee.

## Comments
Not sure how this would actually work properly without the user recompiling the app to handle server differences. For example, even when we use our own server but switch between v1 and v2, some code changes are need to handle the differences. At that point, it seems easier for the user to just change the .env file? Anyway...

## Changes
- Added Desktop-only options to define custom server. [Settings > Advanced Settings > "Comment server" section].
2021-08-12 14:01:22 +08:00
infinite-persistence 4731786a3f
Livestream: implement Pinned Comments 2021-08-12 10:39:21 +08:00
infinite-persistence fd66e6b9b1
Refactor Commentron error msg handling
## Issue
6832: Pass through commenting error if it fails current error list

## Changes
- Refactor the error-msg-replacing code to make it easier to add new ones in the future.
- Made the new error message localizable (i.e. extract the variable value, pass to `__()`)
- Fallback to Commentron original message for those unhandled ones (usually fresh messages from Commentron).
2021-08-10 10:26:58 +08:00
infinite-persistence 34368760de Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry

The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.

## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.

## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
  - When clicked, we store the container ID in the navigation history `state` object.
    - For general cases, anyone can check this state from  `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-08-03 09:34:36 -04:00
Baltazar Gomez 79e39da47f update sockety api urls 2021-08-01 09:47:44 -04:00
Baltazar Gomez 9dd065a595 update lighthouse search api 2021-07-30 11:47:28 -04:00
infinite-persistence 76a6c0441c Beautify/elaborate comment spam-check message 2021-07-23 13:33:10 -04:00
infinite-persistence ffad52d5b7 Remove console.log
Seems like lint is being bypassed recently?
2021-07-23 08:42:58 -04:00
infinite-persistence 6e402240b0
Fix muted-words now returning null instead of ""
## Issue
Creating Settings suddenly start to stop loading correctly for some of my channels.

## Change
`settings.List` now returns null instead of empty array. Double-checked the Commentron repo and this is indeed the case.

Updated the code to handle null.
2021-07-23 15:46:38 +08:00
saltrafael b164a5d1f4 Pop up Menu Fixes and Improvements
Pop up Menu Fixes and Improvements

Improve re-directs

Fix file deletion

Improve code, and more

Fix List Layout collection popup

Allow to edit list

Fix blocking when not logged or no channel

Fix Edit and Delete showing for not owned Lists

Fix actions breaking when not logged in

Fix List options not showing

Lint

Shorten logic

Lint
2021-07-21 14:40:44 -04:00
infinite-persistence e5f32b21c4
Reaction-fetch: handle "no results"
If there are no API errors but no reactions returned, consider the requested IDs as "done" and stop requesting again. When a channel is being confirmed, Commentron doesn't return the reaction object.

Also added extra guard in case Commentron does return an object in the future, but an empty one.
2021-07-20 15:22:51 +08:00
zeppi 1d021fc8e0 more 2021-07-19 13:52:15 -04:00
infinite-persistence abe32e5f5c
Revert "Reactions: consider failures as "fetched""
This reverts commit 84a2a74c8c.
2021-07-18 10:55:11 +08:00
Anthony 7bb5df97fd Stripe 2
show visible card and add remove card button

show your transactions even if you dont have a card

fix presentational issues

show your transactions even if you dont have a card

fix presentational issues

add link to channel section

update yarn

show donation location

add remove card modal still needs completion and also changed how stripe is used on settings stripe card page

add confirm remove card modal to router

move bank account stuff to settings page

move account functionality to settings page

continuing to move account transactions to settings

list transactions for creator

updating copy

touchup tip error

do a better job autofocusing

bugfix

show an error on the card page if api returns 500

building out frontend for comment tip

display dollar sign if its a fiat tip

more frontend work

more frontend work

more frontend bug fixes

working with hardcoded payment intent id

working but with one bug

bugfixed

add toast if payment fails

add add card button

cant get claim id but otherwise done

more frontend work

call is working

show fiat for livestream comments

add is fiat on comments

round and show values properly

dont allow review if tiperror

copy displaying properly

disable buttons conditionally properly

remove card button working

remove card working with a workaround by refreshing page

bugfix

send toast when tip on comment

jeremy frontend changes

only show cart on lbc
2021-07-17 13:19:33 -04:00
infinite-persistence 84a2a74c8c
Reactions: consider failures as "fetched"
In the event that Commentron returned an empty object, we'll end up re-requesting the same IDs again. Haven't seens this happen before, but since we don't know what's causing the spike, we'll just consider failures and "fetched" to stop the loop.

User can always click Refresh to repopulate the values.
2021-07-17 21:53:23 +08:00
infinite-persistence cb0222981c Reactions: switch from SDK to Commentron
## Issue
- Closes 6481 "Use Commentron for react.List, react.React calls".
- 5459 "Interact directly with commenting servers".
2021-07-16 13:41:41 -04:00
infinite-persistence 08c701ba19 Restore comment pagination
This reverts commit e6addb8c2a, reversing
changes made to 47b594107a.
2021-07-16 10:54:12 -04:00
zeppi 637c01750a clean 2021-07-15 17:48:02 -04:00
zeppi b2b88b466e fix colon handling 2021-07-15 17:48:02 -04:00
zeppi 0e589c0401 bump 2021-07-15 17:48:02 -04:00
infinite-persistence a2a1ddb403
Revert "Comments Pagination #6390"
This reverts commit 16ef013025, reversing
changes made to fba8b89b3b.
2021-07-15 22:23:26 +08:00
infinite-persistence 4731588a3c
Tell user when linked-comment is not available. 2021-07-14 13:00:26 +08:00
infinite-persistence f8bdd0704f
Handle temporary Commentron bugs
Can be removed when bugs are fixed, but would still work if left there.
2021-07-14 12:58:27 +08:00
infinite-persistence 0cf6fe3df5
Comments Pagination
## Issue
6158 - Support Comment Pagination
2021-07-14 12:58:25 +08:00
infinite-persistence b822ae39e1
Remove hardcoded filters in doSearch
## Issue
6414 <Don't use "exact match" setting outside of main search - cuases no results in related>

`doSearch` was used in Wunderbar and Recommended, but it was adding in Wunderbar options all the time.

## Changes
- Fix `doSearch` to not use hardcoded options (take from arguments).
- Refactors the searchOption-creation code so that we don't duplicate the logic in both .js and .jsx.
2021-07-14 11:16:19 +08:00