Commit graph

142 commits

Author SHA1 Message Date
infinite-persistence
e64d661dcd
Support not_channel_ids through Category definition
Mainly only useful for Wild West, which doesn't use `channel_ids` (otherwise, the homepage maintainer could just exclude the id from `channel_ids` directly).
2022-04-20 22:56:16 +08:00
infinite-persistence
9ad73c9878
Hide the "results filtered by language" hint if the Category forced the language-specific search.
The user won't be able to anything about it anyway.
2022-04-20 22:56:15 +08:00
infinite-persistence
7b85d7a585
Allow Category definitions to specify language to search in.
This will be entirely up to the homepage maintainer, and will override the user's "Search only in the this language" setting.
2022-04-20 22:56:15 +08:00
infinite-persistence
f7beffaa06
Support callback method to inject items
1341
2022-04-18 19:08:09 +08:00
Raphael Wickihalder
19a4b87225
Adjust tile grid for HiRes screens 2022-04-11 16:05:41 +02:00
Raphael Wickihalder
010b5c81f4
Adjust tile grid in categories and channel pages 2022-04-07 19:54:41 +02:00
infinite-persistence
f5034f74ca Batch resolve pin urls in 2 ways
Expanded homepage pins to support 2 types of input (if both are passed in, pinnedUrls take precedence):
  (1) pinnedUrls     --> uses doResolveUris (resolve)
  (2) pinnedClaimIds --> uses doResolveClaimIds (claim_search)

Instead of injecting the pinned URLs directly, we inject from `resolvedPinUris`, which will be blank until the uris are resolved, thus preventing it from being resolved individually from the tiles.

There's additional complexity with the `claim_search` method, as the rest of the code deals with uris instead of IDs. Fortunately, it's all contained with `useResolvePins`, so removal would be easier when the batch `resolve` issue is fixed.
2022-03-31 15:58:10 -04:00
infinite-persistence
dd5f4872fc Minor cleanup, no functional change
- Self-documenting variable.
- Remove incorrect comments.
- Remove redundant variables.
2022-03-31 15:58:10 -04:00
infinite-persistence
cc8812d751 ClaimListDiscover: fix broken excludeUris logic 2022-03-29 22:39:36 -04:00
infinite-persistence
5196468330 Make ClaimListDiscover retain results while searching
Ticket: 946

- Copied the functionality from ClaimTileDiscover. Tried to use the same variable names to help the future consolidation work.

- Removed `excludeUris` from `ClaimList` as it makes the caching harder.
2022-03-21 12:53:56 -04:00
mayeaux
fb3a73d8a7
Membership subscriptions (#812)
Enter: Odysee Premium.
2022-03-09 13:05:37 -05:00
infinite-persistence
0143b63c74 Ads: replace DOM manipulations with React components
- Instead of 2 ways to display ads (DOM injection + React method) and having both of them clash, just do it the predictable React way.
    - Augment the existing React version to support tile layout + ability to place in last visible slot.
    - Consolidate styling code to scss ... DOM manipulations were making it even harder to maintain.
    - Removed the need to check for ad-blockers for now. It was being executed every time an ad is displayed, and now that we are displaying ads in more places, the gains doesn't justify the performance loss. Also, it wasn't being done for Recommended ads anyway, so the inconsistency probably means it's not needed in the first place.

Other known issues fixed:
- double ad injection when changing language via nag.
- additional "total-blocking-time" due to ads at startup removed.
- fixed ads not appearing in mobile homepage until navigated away and back to homepage.
- enable ads in channel page.
- support for both List and Tile layout.
2022-03-08 10:53:52 -05:00
infinite-persistence
1249b0394e claim_search: support ordering by 'name' 2022-03-01 10:50:07 -05:00
infinite-persistence
5f92ccbf47 ClaimListDiscover: add subSection area
This will be an additional area under Header/Meta that clients can put anything with.

Primary impetus is to place the Livestream Tiles in Wild West.
2022-03-01 10:27:09 -05:00
infinite-persistence
1777397f07 Add hint that results are being filtered by language 2022-02-25 16:53:45 -05:00
infinite-persistence
3974ca6322 ClaimListDiscover: if 'uris' is given, there is no need to perform a search
This was causing unnecessary calls that won't be used.
2022-02-25 16:53:45 -05:00
infinite-persistence
c6d8687cfa ClaimListDiscover: pull out 'claim_search' language code for re-use, so all clients are sending the same value. No functional change. 2022-02-25 16:53:45 -05:00
infinite-persistence
db5d0a70aa
Ignore "search in language" setting in Channel Page (#944)
It's confusing to see blank channel pages due to this setting.
2022-02-23 09:43:42 -05:00
Thomas Zarebczan
df2ed078b3
Fix collection filter 2022-01-17 12:06:59 -05:00
infinite-persistence
344da194ca
Resolve claim and stream types when there is a filter (#696)
* Resolve claim and stream types when there is a filter

## Symptom
Channel Page 'Content Type' filter not working

## Issue
The Advanced Filter work by placing a `?content=` URL param. The list component then parses it and makes the `claim_search` params accordingly. But:

1. There is a mix up in how the list component treats `?content=`.
    - The original code seems to treat this as a way to define the type externally but only for a list without `claimType` defined via code. In other words, if `claimType="something"`, `?content=` is ignored.
    - On the other hand, the Advanced Filter relies on `?content=` being used.

2. `?content=` is then split between `claimType` and `streamType`. The current code does not check if the split makes sense, e.g. if `?content=channel` and `streamType=['video']`, these 2 are incompatible and produces no results.

## Change
1. I'm not really sure what's the original intention, but let's just make `?content=` as an override/filter.

2. `?content=` should probably be limited to always be a subset of `claimType` and `streamType`. But this seems complicated to do, so for now let's just make always override/filter everything.  For that, we need to make sure the filtered `claimType` -- `streamType` combo makes sense.

* Fix 'Channel' filter not working in Wild West

## Cause
The Wild West list defines `release_time` to be 1 week ago. As long as this parameter exists, a channel `claim_search` produces no results (I thought channels have creation dates?). That is why an unfiltered Wild West never showed Channel Tiles.

## Change
The existing `release_time` handling does seem to hint that we should not set the parameter when searching for Channels. Expanded that to consider the final (filtered) claim type, not just the original.
2022-01-14 11:06:13 -05:00
infinite-persistence
0d6cd21457
Fix ignored 'Content Type' filter (#694)
## Issue
After enabling Advanced Filter in Category Pages, the 'Content Type' filter only works for "repost/video/list".

## Root-cause
When `streamType` is not provided, it defaults to 'Video|Audio', making it always "defined":

```
streamType = SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
```

This seem to override the purpose of `defaultStreamType`, which will not be used unless the client explicitly set `streamType=null`, which currently is only being applied for `RECENT_FROM_FOLLOWING[]`.

```
  const streamTypeParam =
    streamType || (CS.FILE_TYPES.includes(contentTypeParam) && contentTypeParam) || defaultStreamType || null;
```
2022-01-13 22:03:04 -05:00
Dan Peterson
a89cb17ce4
Add horizontal layout (#636)
* Test out a horizontal scroll for upcoming (tile only for now)

* - add support for list layout
- add following label on home page
- clan up css and naming conventions

* Update header type + show only if scheduled streams are showing
2022-01-06 16:13:26 -05:00
Dan Peterson
038692cafc
Feature livestream scheduling (#458)
Add livestream scheduling feature
Also supports back to back streams, and will notify on a non-active stream of an active one.
2021-12-16 16:59:13 -05:00
infinite-persistence
3b87f0aba6 Remove content_tags and related functions
No longer necessary.

Also removed a few doToggleTagFollowDesktop props (unused by the View).
2021-12-13 11:54:53 -05:00
infinite-persistence
7e9e213974
Add pinning in Category Pages's Trending Tab (#399)
Closes https://github.com/OdyseeTeam/odysee-homepages/issues/427
2021-12-01 10:18:57 -05:00
infinite-persistence
5c643cc796
Re-enable reposts on homepages (#352)
* Add remove_duplicates to tile/list claim_search except for Channel Page

This removes the any duplicates from reposts.

* Re-activate the "Hide reposts" setting

* Category Rows: default to ['stream', 'repost'] unless specified otherwise.
2021-11-24 11:11:25 -05:00
Merge
30023422b8
Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
Thomas Zarebczan
eaa32e4df4
Odysee references revamp, part1 2021-10-08 15:22:07 -04: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
30fedf6b45
Channel Page: enable filters; add "sort by" filter (#7069)
* Sort props to clarify "client vs. redux". No functional change.

* ClaimListHeader: remove SIMPLE_SITE gating

* Channel Page: enable filters; add "sort by" filter.

## Issue
7059 Add option to sort oldest first on channel page

## Changes
- Enabled filters for Odysee.
- Added a new "Sort By" filter, which will only appear for "New" ordering. It doesn't make sense for "Trending" or "Top".
2021-09-13 11:23:53 -04:00
infinite-persistence
c2a2068926
Sort props to clarify "client vs. redux". No functional change. 2021-09-13 15:02:45 +08:00
infinite-persistence
663ae2762f
Don't fetch view_count on empty list.
Also guard against null array.
2021-09-09 22:05:48 +08:00
infinite-persistence
093c427b83
Show content view counts on channel pages
## Issue
3587 Show content view counts on channel pages

## Notes
Limited to just "channel pages" for now as specified in the ticket.

Can be enabled for all claim previews, as long as there's an efficient spot to run the batch fetching. Either make `fetchViewCount` prop default to true, or add the parameter in places that need it.
2021-09-09 18:31:48 +08:00
jessopb
049fb2878e
recsys v0.2 (#6977)
* recsys wip

better logging

fix floating player popout playing uri bug with recsys

lint

add empty entries to create

use beacon; fire on visibilitychange

cleanup, not record recs if not seen

ifweb recsys beacon

recsys handle embeds, cleanup

use history.listen to trigger events

fix recsys embed bug

bugfix

more default data

cleaner

cleaner

* remove tentative

* disable recsys debug logging
2021-09-02 18:39:40 -04:00
Thomas Zarebczan
c6ad44d1e5
Consider more live streams (#6974)
and order by release time always

f
2021-08-27 10:57:54 -04:00
Thomas Zarebczan
4586fbc34b
Revert "Fix stream type for livestreams (#6967)" (#6972)
This reverts commit ee609c654f.
2021-08-26 11:50:57 -04:00
Thomas Zarebczan
ee609c654f
Fix stream type for livestreams (#6967)
* Fix stream type for livestreams

Was picking up collections 

+ other tweaks

* Update search.js
2021-08-26 11:04:24 -04:00
infinite-persistence
4a8c08c8bf
Fix scroll position not restored when doing Back on Desktop (#6842)
## Ticket
6743: Desktop: "Back" in Following Page no longer restores scroll position

## Issue
This was a side-effect of "6609 claimListDiscover: don't re-render until query is done". That PR did not handle the case of navigating backwards, which typically would just need to display past results. It ended up always starting with a blank list on mount, so the scroll position could not be restored correctly.

I don't know why it still worked on Web/Chrome -- maybe the latest browser knows how to move to desired scroll position when the height is available.

## Change
If navigating backwards, initialize the final URI list with the previous result. It is almost always correct, and if not, will be corrected in the effects. This saves us one re-render when navigating backwards too.
2021-08-16 16:45:04 -04:00
zeppi
fe35ea3764 stream type string or array 2021-08-03 14:49:59 -04:00
zeppi
67bcc1b1ec build 2021-08-03 14:49:59 -04:00
infinite-persistence
50c606d916 claimListDiscover: don't re-render until query is done
## Issue
6542 Livestream listing and blocked list kills CLS score

This is basically a repeat of what was done on `claimTileDiscover` (homepage), but now on `claimListDiscover` (category pages).

This handles the unnecessary re-render when:
- the uri list temporarily being zero while waiting for new claim-search results.
- livestream claim-search invalidating the list.

## Changes
Store the last uri list and use that when we know that claim-search is still not done.

## Tests
1. Ran Lighthouse on category pages (force a livestream channel on it). CLS score must be green.
2. Block `claim_search` from Dev Tools and move to another category. The page should say "timed out" instead of "no results" (i.e. maintain existing behavior).
2021-07-21 21:51:12 -04:00
zeppi
fdca58727c restore paid content 2021-07-21 12:49:56 -04:00
zeppi
26e67b375c more 2021-07-19 13:52:15 -04:00
zeppi
dfc013d423 more recon 2021-07-18 11:27:05 -04:00
zeppi
b2b88b466e fix colon handling 2021-07-15 17:48:02 -04:00
jessopb
be879ae90a
Recon 7 6 b (#6418)
* changes

* clean

* showNoSourceClaims
2021-07-07 14:21:11 -04:00
zeppi
761974ca6f extra collection publish buttons, styling 2021-06-15 18:37:35 -04:00
saltrafael
2aaa9f358b Additional pop up menu options 2021-06-15 13:47:56 -04:00
zeppi
d55ef7e899 Empty states for channel tabs 2021-06-10 17:47:02 -04:00
saltrafael
3131b48c77
Fix blocking/muting issues on channel pages (#6034)
* dont use no_channel_ids on channel content claim search

* ClaimMenuList not filtering own content initially

* fix errors

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
2021-05-15 01:53:56 -04:00