Compare commits

..
Author SHA1 Message Date
Anthony dbf374ef52 fix lot of linting errors and make command more userful 2021-08-12 08:34:50 -04:00
574 changed files with 37421 additions and 6669 deletions

No files matched your search

+83 -29
View File
@@ -1,36 +1,29 @@
####### .env.default #########
# Copy this file to .env to make modifications
# Base config
MATOMO_URL=https://analytics.lbry.com/
MATOMO_ID=4
WEBPACK_WEB_PORT=9090
WEBPACK_ELECTRON_PORT=9091
WEB_SERVER_PORT=1337
LBRY_WEB_API=https://api.lbry.tv
## APIS
LBRY_WEB_API=https://api.na-backend.odysee.com
LBRY_WEB_STREAMING_API=https://cdn.lbryplayer.xyz
LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video
COMMENT_SERVER_API=https://comments.lbry.com/api/v2
COMMENT_SERVER_API=https://comments.odysee.com/api/v2
COMMENT_SERVER_NAME=Odysee
SEARCH_SERVER_API=https://lighthouse.odysee.com/search
SOCKETY_SERVER_API=wss://sockety.odysee.com/ws
THUMBNAIL_CDN_URL=https://image-processor.vanwanet.com/optimize/
WELCOME_VERSION=1.0
# Custom Site info
DOMAIN=lbry.tv
URL=https://lbry.tv
THUMBNAIL_CDN_URL=https://image-optimizer.vanwanet.com/?address=
# STRIPE
STRIPE_PUBLIC_KEY='pk_test_NoL1JWL7i1ipfhVId5KfDZgo'
# UI
SITE_TITLE=lbry.tv
SITE_NAME=lbry.tv
SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland.
SITE_HELP_EMAIL=help@lbry.com
LOGO_TITLE=lbry.tv
SIMPLE_SITE=false
SHOW_ADS=true
YRBL_HAPPY_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
ENABLE_COMMENT_REACTIONS=true
ENABLE_FILE_REACTIONS=false
ENABLE_CREATOR_REACTIONS=false
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
# Analytics
MATOMO_URL=https://analytics.lbry.com/
MATOMO_ID=4
# OG
OG_TITLE_SUFFIX=| lbry.tv
@@ -38,23 +31,84 @@ OG_HOMEPAGE_TITLE=lbry.tv
OG_IMAGE_URL=
SITE_CANONICAL_URL=https://lbry.tv
# UI
## Custom Site info
DOMAIN=lbry.tv
URL=https://lbry.tv
SITE_TITLE=lbry.tv
SITE_NAME=lbry.tv
SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland.
SITE_HELP_EMAIL=help@lbry.com
LOGO_TITLE=lbry.tv
## Social media
TWITTER_ACCOUNT=LBRYcom
BRANDED_SITE=odysee
## IMAGE ASSETS
YRBL_HAPPY_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
#LOGIN_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/login/b671946e911c66c5fa7233afb35de2badd9eceb8/0e1d81
#LOGO=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
#LOGO_TEXT_LIGHT=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
#LOGO_TEXT_DARK=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
#AVATAR_DEFAULT=
#FAVICON=
# LOCALE
DEFAULT_LANGUAGE=en
# Custom Settings
## CUSTOM SETTINGS
# Additional settings for below are found in ui/constants/settings and are for
# preventing user settings from applying to custom sites without overwriting them.
# UNSYNCED_SETTINGS='theme dark_mode_times automatic_dark_mode_enabled'
## LINKED CONTENT WHITELIST
KNOWN_APP_DOMAINS=lbry.tv,lbry.lat,odysee.com
# Custom Content
## CUSTOM CONTENT
# If the following is true, copy custom/homepage.example.js to custom/homepage.js and modify
CUSTOM_HOMEPAGE=false
# Add channels to auto-follow on first run
AUTO_FOLLOW_CHANNELS=lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a
# Add up to 2 sidebar links:
# PINNED_URI_1=@Lbrylatam#2/Integracionesporseguridad#4
# PINNED_LABEL_1=LBRY LATAM
# PINNED_URI_2=$/discover?t=lbrytvpaidbeta&fee_amount=>0&claim_type=stream&channel_ids=5af39f818f668d8c00943c9326c5201c4fe3c423,cda9c4e92f19d6fe0764524a2012056e06ca2055,760da3ba3dd85830a843beaaed543a89b7a367e7,40c36948f0da072dcba3e4833e90f71e16de78be,e8f68563d242f6ac9784dcbc41dd86c28a9391d6,7236fc5d2783ea7314d9076ae6c8a250e3992d1a,cf7792c2a37d0d76aaaff84aff0b99a8c791429d,8316ac90764fedf3147799b7b81a6575a9cc398e,8627af93c1a1219150f06b698f4b33e6ed2f1c1e,8972a1bd06de5186e5e89292b05aac8aaa817791,c5b0b17838df2f6c31162f64d55f60f34ae8bfc6,f576d5dba905fc179de880c3fe3eb3281ea74f59,97dd77c93c9603cbb2583f3589f7f5a6c92baa43,f399d873e0c37cf24de9569b5f22bbb30a5c6709,dba870d0620d41b2b9a152c961e0c06cf875ccfc,ca1fd651c9d14bf2e5088bb2aa0146ee7aeb2ae0,50ad846a4b1543b847bf3fdafb7b45f6b2f5844c,e09ff5abe9fb44dd0dd0576894a6db60a6211603,7b6f7517f6b816827d076fa0eaad550aa315a4e7,2068452c41d8da3bd68961335da0072a99258a1a,5da63df97c8255ae94a88940695b8471657dd5a1,3645cf2f5d0bdac0523f945be1c3ff60758f7845,4da85b12244839d6368b9290f1619ff9514ab2a8,4ad942982e43326c7700b1b6443049b3cfd82161,55304f219244abf82f684f759cc0c7769242f3b4,8f42e5b592bb7f7a03f4a94a86a41b1236bb099f,e2a014d885a48f5be2dc6409610996337312facb,c18996ca488753f714d36d4654715927c1d7f9c2,ebc4214424cfa683a7046e1f794fea1e44788d84,06b6d6d6a893fb589ec2ded948f5122856921ed5,07e4546674268fc0222b2ca22d31d0549dc217ee,060940e41973d4f7f16d72a2733138e931c35f41,f8d6eccd887c9cebd36b1d42aa349279b7f5c3ed,68098b8426f967b8d04cc566348b5c128823219e,2bfe6cdb24a21bdc1b76fb7c416edd50e9e85945,1f9bb08bfa2259629f4aaa9ed40f97e9a41b6fa1,2f20148495612946675fe1c8ea99171e4d950b81,bc6938fa1e09e840056c2e831abf9664f397c472,2a6194792beac5130641e932b5ac6e5a99b5ca4f,185ba2bd547a5e4a77d29fe6c1484f47db5e058f,29cc7f6081268eaa5b3f2946e0cd0b952a94812c,49389450b1241f5d8f4c8c4271a3eb56bba33965,ffdc62ac2f7549398d3aca9d2119e83d80d588d5,d7a4d2808074b0c55d6b239f69d90e7a4930f943,d58aa4a0b2f6c2504c3abce8de3f1afb71800acc,77ae23dc7eb8a75609881d4548a79e4935a89d37,f79bce8a60fbece671f6265adc39f6469f3b9b8c,051995fdf0af634e4911704057a551e9392e62b1
# PINNED_LABEL_2=Paid Beta
## FEATURES AND LIMITS
SIMPLE_SITE=false
#BRANDED_SITE
ENABLE_COMMENT_REACTIONS=true
ENABLE_FILE_REACTIONS=false
ENABLE_CREATOR_REACTIONS=false
ENABLE_NO_SOURCE_CLAIMS=false
ENABLE_PREROLL_ADS=false
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
CHANNEL_STAKED_LEVEL_LIVESTREAM=5
WEB_PUBLISH_SIZE_LIMIT_GB=4
LOADING_BAR_COLOR=#2bbb90
LIGHTHOUSE_DEFAULT_TYPES=audio,video,text,image,application
SHOW_ADS=true
## SIMPLE_SITE REPLACEMENTS
ENABLE_MATURE=true
ENABLE_UI_NOTIFICATIONS=false
#ENABLE_LINK_TO_APP=true
#FORCE_ANALYTICS=true
#ENABLE_ADVANCED_FILTER=true
#ENABLE_PAID_CONTENT=true
#USE_FOOTER=true
#USE_DISCOVER_WHITELIST=false
#ENABLE_WILD_WEST=false
#FULL_SIDE_LINKS=true
#SHOW_TAGS_INTRO=false
# SEARCH TYPES
#VIDEO_ENABLED=true
#AUDIO_ENABLED=true
#POSTS_ENABLED=true
#IMAGES_ENABLED=true
#FILES_ENABLED=true
#MODELS_ENABLED=true
BRANDED_SITE=odysee
+2 -1
View File
@@ -35,13 +35,14 @@
"object-curly-spacing": 0,
"one-var": 0,
"prefer-promise-reject-errors": 0,
"promise/param-names": 0,
"react/jsx-indent": 0,
"react/jsx-no-comment-textnodes": 0,
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/no-unescaped-entities": 0,
"space-before-function-paren": [
"error",
"warn",
{
"anonymous": "never",
"named": "never",
+1
View File
@@ -1,6 +1,7 @@
[ignore]
.*\.typeface\.json
.*/node_modules/findup/.*
.*/node_modules/react-plastic/.*
[include]
+28 -13
View File
@@ -1,14 +1,24 @@
## PR Checklist
## Fixes
<!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" -->
Issue Number:
Please check all that apply to this PR using "x":
<!-- Tip:
- Add keywords to directly close the Issue when the PR is merged.
- Skip the keyword if the Issue contains multiple items.
- https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
- [ ] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
- [ ] I have checked that this PR does not introduce a breaking change
- [ ] This PR introduces breaking changes and I have provided a detailed explanation below
## What is the current behavior?
## PR Type
## What is the new behavior?
## Other information
<!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
## PR Type & Checklist
<details><summary>PR Type...</summary>
What kind of change does this PR introduce?
@@ -19,14 +29,19 @@ What kind of change does this PR introduce?
- [ ] Documentation changes
- [ ] Other - Please describe:
## Fixes
</details>
Issue Number:
<!---------------------------------------------------------------------------->
## What is the current behavior?
<details><summary>PR Checklist...</summary>
## What is the new behavior?
<!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" -->
## Other information
Please check all that apply to this PR using "x":
<!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
- [ ] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
- [ ] I added a line describing my change to CHANGELOG.md
- [ ] I have checked that this PR does not introduce a breaking change
- [ ] This PR introduces breaking changes and I have provided a detailed explanation below
</details>
+3 -1
View File
@@ -57,7 +57,7 @@ jobs:
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
WIN_CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2020-2021-08.p12
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-cert.p12
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-csc-2021-2022.p12
# UI
MATOMO_URL: https://analytics.lbry.com/
@@ -72,6 +72,8 @@ jobs:
YRBL_HAPPY_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
YRBL_SAD_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
ENABLE_COMMENT_REACTIONS: true
ENABLE_NO_SOURCE_CLAIMS: false
DEFAULT_LANGUAGE: en
KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0
+7
View File
@@ -23,9 +23,16 @@ package-lock.json
/web/.env.defaults
/custom/*
/custom/homepages/*
/custom/content/*
!/custom/content/default.json
!/custom/content/test.json
!/custom/homepages/.gitkeep
!/custom/homepages
!/custom/content
!/custom/homepage.example.js
!/custom/robots.disallowall
!/custom/robots.allowall
.env
.env.ody
.env.desktop
.env.lbrytv
+1 -1
View File
@@ -3,7 +3,7 @@
"ui/**/*.{js,jsx,scss,json}": ["prettier --write", "git add"],
"web/**/*.{js,jsx,scss,json}": ["prettier --write", "git add"],
"ui/**/*.{js,jsx}": ["eslint", "flow focus-check --color always", "git add"],
"web/**/*.{js,jsx,scss}": ["eslint", "git add"]
"web/**/*.{js,jsx}": ["eslint", "git add"]
},
"ignore": ["node_modules", "web/dist/**/*", "dist/**/*", "package-lock.json"]
}
+102 -3
View File
@@ -1,14 +1,112 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased on desktop]
## [Unreleased for Desktop]
### Added
- Show currently active playing item on playlist _community pr!_ ([#6453](https://github.com/lbryio/lbry-desktop/pull/6453))
- Add watch later to hover action for last used playlist on popup _community pr!_ ([#6274](https://github.com/lbryio/lbry-desktop/pull/6274))
- Add confirmation on comment removal _community pr!_ ([#6563](https://github.com/lbryio/lbry-desktop/pull/6563))
- Show on content page if a file is part of a playlist already _community pr!_([#6393](https://github.com/lbryio/lbry-desktop/pull/6393))
### Changed
- Use Canonical Url for copy link ([#6500](https://github.com/lbryio/lbry-desktop/pull/6500))
- Use better icon for copy link ([#6485](https://github.com/lbryio/lbry-desktop/pull/6485))
- Comments load paginated ([#6390](https://github.com/lbryio/lbry-desktop/pull/6390))
- Improve twitter share _community pr!_ ([#6690](https://github.com/lbryio/lbry-desktop/pull/6690))
- Update lighthouse search api _community pr!_ ([#6731](https://github.com/lbryio/lbry-desktop/pull/6731))
- Update sockety api _community pr!_ ([#6747](https://github.com/lbryio/lbry-desktop/pull/6747))
- Use resolve for OG metadata instead of chainquery _community pr!_ ([#6787](https://github.com/lbryio/lbry-desktop/pull/6787))
### Fixed
- App now supports '#' and ':' for claimId separator ([#6496](https://github.com/lbryio/lbry-desktop/pull/6496))
- Fix "exact match" being applied to Recommended ([#6460](https://github.com/lbryio/lbry-desktop/pull/6460))
- Fix upload button on creator analytics _community pr!_ ([#6458](https://github.com/lbryio/lbry-desktop/pull/6458))
- Prevent sidebar shortcut activation on textarea _community pr!_ ([#6454](https://github.com/lbryio/lbry-desktop/pull/6454))
- Improve accessibility and some minor css fixes _community pr!_ ([#6470](https:/github.com/lbryio/lbry-desktop/pull/6470))
- Fix drag / drop publish issues for web users _community pr!_ ([#6466](https://github.com/lbryio/lbry-desktop/pull/6466))
- Fix yarn copyenv on windows _community pr!_ ([#6702](https://github.com/lbryio/lbry-desktop/pull/6702))
- Fix unnecessary livestream api calls in channel page _community pr!_ ([#6652](https://github.com/lbryio/lbry-desktop/pull/6652))
- Fix desktop app fails to resolve deep links _community pr!_ ([#6779](https://github.com/lbryio/lbry-desktop/pull/6779))
- Fix wrong release date on GoogleVideo metadata _community pr!_ ([#6787](https://github.com/lbryio/lbry-desktop/pull/6787))
- Fix markdown line breaking mid word _community pr!_ ([#6805](https://github.com/lbryio/lbry-desktop/pull/6805))
- Added \ and = to reserved symbol warning _community pr!_ ([#6733](https://github.com/lbryio/lbry-desktop/pull/6733))
- Don't break words in chat + fix text overflow past 3 dot menu _community pr!_ ([#6602](https://github.com/lbryio/lbry-desktop/pull/6602))
- Fix embed shows wrong OG metadata _community pr!_ ([#6815](https://github.com/lbryio/lbry-desktop/pull/6815))
- Fix OG: "Unparsable data structure - Truncated Unicode character" _community pr!_ ([#6839](https://github.com/lbryio/lbry-desktop/pull/6839))
## [0.51.1] - [2021-06-26]
### Added
- Wallet balance UI improvements ([#5276](https://github.com/lbryio/lbry-desktop/pull/5387))
### Changed
### Fixed
- Enable sign up on desktop ([#6071](https://github.com/lbryio/lbry-desktop/issues/6071))
## [0.51.0] - [2021-06-26]
### Added
- Private and Publishable Playlists ([#6157](https://github.com/lbryio/lbry-desktop/pull/6157))
- Channel thumbnails in following side menu ([#6193](https://github.com/lbryio/lbry-desktop/pull/6193))
- Web is now PWA app ([#6120](https://github.com/lbryio/lbry-desktop/pull/6120))
- Send a tip with your comment ([#5920](https://github.com/lbryio/lbry-desktop/issues/5920))
- Search for tags in search dropdown ([#5876](https://github.com/lbryio/lbry-desktop/issues/5876))
- Japanese, Afrikaans, Filipino, Thai and Vietnamese language support ([#5684](https://github.com/lbryio/lbry-desktop/issues/5684))
- Brazilian-Portuguese language support ([#5900](https://github.com/lbryio/lbry-desktop/issues/5900))
- Highlight comments made by content owner _community pr!_ ([#5744](https://github.com/lbryio/lbry-desktop/pull/5744))
- Ability to report infringing content directly from the application ([#5808](https://github.com/lbryio/lbry-desktop/pull/5808))
- Re-added ability to export wallet transactions ([#5899](https://github.com/lbryio/lbry-desktop/pull/5899))
- 24-hour clock setting _community pr!_ ([#5820](https://github.com/lbryio/lbry-desktop/pull/5820))
- "Related" (recommendations) section: added option to view more from current creator _community pr!_ ([#5847](https://github.com/lbryio/lbry-desktop/pull/5847))
- Wallet: ability to swap cryptocurrency into LBC ([#5654](https://github.com/lbryio/lbry-desktop/pull/5654))
- Wallet: ability to send LBC directly to a user through a name or URL search _community pr!_ ([#5990](https://github.com/lbryio/lbry-desktop/pull/5990))
- Publish: ability to edit the Release Date field ([#6049](https://github.com/lbryio/lbry-desktop/pull/6049))
- Creator Settings: ability to mute specific words in comments ([#5934](https://github.com/lbryio/lbry-desktop/pull/5934))
- Creator Settings: ability to disable comments + assign moderators ([#6199](https://github.com/lbryio/lbry-desktop/pull/6199))
- Additional options in context-menu _community pr!_ ([#6106](https://github.com/lbryio/lbry-desktop/pull/6106))
### Changed
- Keyboard shortcut additions and changes _community pr!_ ([#5717](https://github.com/lbryio/lbry-desktop/pull/5717))
- Removed the 10k character-limit when editing _Posts_ ([#5719](https://github.com/lbryio/lbry-desktop/pull/5719))
- Improved search functionality (more filters, infinite-scroll, etc.) ([#5742](https://github.com/lbryio/lbry-desktop/pull/5742))
- Removed google related section ads ([#6312](https://github.com/lbryio/lbry-desktop/pull/6312))
- Debounce and min characters on wunderbar search ([#6319](https://github.com/lbryio/lbry-desktop/pull/6319))
- Don't use optimizer for gif thumbnails ([#6320](https://github.com/lbryio/lbry-desktop/pull/6320))
- Upgraded [LBRY SDK 0.99.0](https://github.com/lbryio/lbry/releases/tag/v0.99.0)
### Fixed
- Lazy-load claim images to improve app responsiveness ([#5795](https://github.com/lbryio/lbry-desktop/issues/5795))
- Fix display of upload date and view count on smaller screens ([#5822](https://github.com/lbryio/lbry-desktop/issues/5822))
- Autoplay looping to a previous video or itself ([#5711](https://github.com/lbryio/lbry-desktop/pull/5711))
- Autoplay not working in mini-player mode ([#5716](https://github.com/lbryio/lbry-desktop/pull/5716))
- Edited claim accidentally moved to 'Anonymous' ([#5767](https://github.com/lbryio/lbry-desktop/pull/5767))
- Squished "Upload Date" and "View Count" on smaller screens _community pr!_ ([#5823](https://github.com/lbryio/lbry-desktop/pull/5823))
- Home and End key not working in search bar ([#5867](https://github.com/lbryio/lbry-desktop/pull/5867))
- Unable to buy paid-Images or Posts ([#6114](https://github.com/lbryio/lbry-desktop/pull/6114))
## [0.50.2] - [2021-04-2]
### Changed
- Disable PDFs until security issue is fixed
## [0.50.1] - [2021-03-18]
### Fixed
- Upgrade modal extended beyond the height of the app ([#5709](https://github.com/lbryio/lbry-desktop/pull/5709))
## [0.50.0] - [2021-03-18]
### Added
- New moderation tools: block & mute ([#5572](https://github.com/lbryio/lbry-desktop/pull/5572))
- Improved markdown file styling ([#5659](https://github.com/lbryio/lbry-desktop/pull/5659))
- Mass tip unlock ([#5409](https://github.com/lbryio/lbry-desktop/pull/5387))
- Zoomable image viewer in Markdown (posts and comments) _community pr!_ ([#5387](https://github.com/lbryio/lbry-desktop/pull/5387))
- Enable PDF Viewer in App _community pr!_ ([#2903](https://github.com/lbryio/lbry-desktop/issues/2903))
@@ -18,6 +116,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Updated lbry-sdk to [0.92.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.92.0)
- Re-enable PDF Viewer in desktop app _community pr!_ ([#5420](https://github.com/lbryio/lbry-desktop/issues/5420))
### Fixed
+24 -26
View File
@@ -1,21 +1,19 @@
# Contribute to LBRY
**First:** if you're unsure or afraid of anything, just ask or submit the issue or pull request anyways. You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that.
However, for those individuals who want a bit more guidance on the best way to contribute to the project, read on. This document will cover what we're looking for. By addressing all the points we're looking for, it raises the chances we can quickly merge or address your contributions.
## TL;DR?
* [Here](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
- [Here](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
is a list of help wanted issues.
* Comment on an issue to let us know if you are going to work on it, don't take an issue that someone reserved less than 3 days ago.
* Submit a pull request and get paid in LBC.
* Don't hesitate to contact us with any questions or comments.
* [Check out this video for a quickstart guide to running and developing the desktop app](https://spee.ch/7da73fc508ffc4ff8b2711e3c3950110430b0c5f/LBRYAppDesign.mp4).
- Comment on an issue to let us know if you are going to work on it, don't take an issue that someone reserved less than 3 days ago.
- Submit a pull request and get paid in LBC.
- Don't hesitate to contact us with any questions or comments.
## Contents
- [Choose an Issue](#choose-an-issue)
- [Code Overview](#code-overview)
- [Libraries](#libraries)
@@ -38,20 +36,20 @@ receives contributions from individuals outside the core team -- such as yoursel
To make contributing as easy and rewarding as possible, we have instituted the following system:
* Anyone can view all issues in the system by clicking on the
- Anyone can view all issues in the system by clicking on the
[Issues](https://github.com/lbryio/lbry-desktop/issues) button at the top of the page. Feel free to
add an issue if you think we have missed something (and you might earn some LBC in the process
because we do tip people for reporting bugs).
* Once on the [Issues](https://github.com/lbryio/lbry-desktop/issues) page, a potential contributor can
- Once on the [Issues](https://github.com/lbryio/lbry-desktop/issues) page, a potential contributor can
filter issues by the
[Help Wanted](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
label to see a curated list of suggested issues with which community members can help.
* Every
- Every
[Help Wanted](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
issue is ranked on a scale from zero to four.
| Level | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| Level | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [**level 0**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+0%22+no%3Aassignee) | Typos and text edits -- a tech-savvy non-programmer can fix these. |
| [**level 1**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+1%22+no%3Aassignee) | Programming issues that require little knowledge of how the LBRY app works. |
| [**level 2**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+2%22+no%3Aassignee) | Issues of average difficulty that require the developer to dig into how the app works a little bit. |
@@ -80,7 +78,7 @@ our styling rules and code best practices.
### Libraries
This project uses [lbry-redux](https://github.com/lbryio/lbry-redux) and [lbryionc](https://github.com/lbryio/lbryinc) to share Redux and LBRY API specific code with [lbry-android](https://github.com/lbryio/lbry-android) and other LBRY apps. Over time, more Redux code that is suitable to be shared will be moved into lbry-redux. If modifying Redux code, you may be asked to make some of your changes in lbry-redux rather than lbry-desktop. The steps to work with lbry-redux locally can be found [here](https://github.com/lbryio/lbry-redux#local-development).
This project uses [lbry-redux](https://github.com/lbryio/lbry-redux) and [lbryionc](https://github.com/lbryio/lbryinc) to share Redux and LBRY API specific code with other LBRY apps. Over time, more Redux code that is suitable to be shared will be moved into lbry-redux. If modifying Redux code, you may be asked to make some of your changes in lbry-redux rather than lbry-desktop. The steps to work with lbry-redux locally can be found [here](https://github.com/lbryio/lbry-redux#local-development).
### Flow
@@ -140,15 +138,15 @@ Editor integrations are available [here](https://prettier.io/docs/en/editors.htm
There are a few tools integrated to the project that will ease the process of debugging:
* [Chrome DevTools](https://developer.chrome.com/devtools)
* Also available for the main process as a [remote target](chrome://inspect/#devices).
* [Electron Devtron](https://electronjs.org/devtron)
* [React DevTools](https://github.com/facebook/react-devtools)
* [Redux DevTools](https://github.com/gaearon/redux-devtools)
- [Chrome DevTools](https://developer.chrome.com/devtools)
- Also available for the main process as a [remote target](chrome://inspect/#devices).
- [Electron Devtron](https://electronjs.org/devtron)
- [React DevTools](https://github.com/facebook/react-devtools)
- [Redux DevTools](https://github.com/gaearon/redux-devtools)
## Submit a Pull Request
* After deciding what to work on, a potential contributor can
- After deciding what to work on, a potential contributor can
[fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes,
and submit a
[pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). A
@@ -157,12 +155,12 @@ There are a few tools integrated to the project that will ease the process of de
manner and, therefore, not begin working on anything reserved (or updated) within the last 3 days.
If someone has been officially assigned an issue via GitHub's assignment system, it is also not
available. Contributors are encouraged to ask if they have any questions about issue availability.
* The [changelog](https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md) should be updated to
- The [changelog](https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md) should be updated to
include a reference to the fix/change/addition. See previous entries for format.
* Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure
- Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure
it is up to our standards. At this point, the contributor may have to change his or her code based
on our suggestions and comments.
* Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in
- Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in
LBC) for the contribution.
We are dedicated to being fair and friendly in this process. In **general**, level 4 issues will be
@@ -191,10 +189,10 @@ will earn you an extra 50 LBC on top of what we would otherwise tip you.
# Get in Touch
| Name | Role | Discord | Email |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------
| [Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jiggytom | tom@lbry.com |
| [Sean](https://github.com/seanyesmunt) | The primary engineer working on the app. Feel free to ask any questions about the code. | sean | sean@lbry.com |
| Name | Role | Discord | Email |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- |
| [Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jiggytom | tom@lbry.com |
| [Sean](https://github.com/seanyesmunt) | The primary engineer working on the app. Feel free to ask any questions about the code. | sean | sean@lbry.com |
Join our Discord [here](https://chat.lbry.com/).
+13 -15
View File
@@ -55,7 +55,7 @@ We provide installers for Windows, macOS (v10.12.4, Sierra, or greater), and Deb
| Latest Pre-release | [Download](https://lbry.com/get/lbry.pre.exe) | [Download](https://lbry.com/get/lbry.pre.dmg) | [Download](https://lbry.com/get/lbry.pre.deb) |
Our [releases page](https://github.com/lbryio/lbry-desktop/releases) also contains the latest
release, pre-releases, and past builds.
release, pre-releases, and past builds.
_Note: If the deb fails to install using the Ubuntu Software Center, install manually via `sudo dpkg -i <path to deb>`. You'll need to run `sudo apt-get install -f` if this is the first time installing it to install dependencies_
To install from source or make changes to the application, continue to the next section below.
@@ -63,10 +63,10 @@ To install from source or make changes to the application, continue to the next
**Community maintained** builds for Arch Linux and Flatpak are available, see below. These installs will need to be updated manually as the in-app update process only supports Debian installs at this time.
_Note: If coming from a deb install, the directory structure is different and you'll need to [migrate data](https://lbry.com/faq/backup-data)._
| | Flatpak | Arch | ARM/ARM64 |
| -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------- |
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Build Guide](https://lbry.tv/@LBRYarm:5) |
| Maintainers | [@kcSeb](https://keybase.io/kcseb) | [@kcSeb](https://keybase.io/kcseb)/[@TimurKiyivinski](https://github.com/TimurKiyivinski) | [@Madiator2011](https://github.com/kodxana) |
| | Flatpak | Arch | Nixpkgs | ARM/ARM64 |
| -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------- |
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Nixpkgs](https://search.nixos.org/packages?channel=unstable&show=lbry&query=lbry) | [Build Guide](https://lbry.tv/@LBRYarm:5) |
| Maintainers | [@kcSeb](https://keybase.io/kcseb) | [@kcSeb](https://keybase.io/kcseb) | [@Enderger](https://github.com/enderger) | [@Madiator2011](https://github.com/kodxana) |
## Usage
@@ -79,7 +79,7 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
#### Prerequisites
- [Git](https://git-scm.com/downloads)
- [Node.js](https://nodejs.org/en/download/) (v10 required)
- [Node.js](https://nodejs.org/en/download/) (v14 required)
- [Yarn](https://yarnpkg.com/en/docs/install)
1. Clone (or [fork](https://help.github.com/articles/fork-a-repo/)) this repository: `git clone https://github.com/lbryio/lbry-desktop`
@@ -88,16 +88,12 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
#### Run the electron app
`yarn compile:electron` (this is only needed the first time you run the app)
`yarn dev`
- If you want to build and launch the production app you can run `yarn build`. This will give you an executable inside the `/dist` folder. We use [electron-builder](https://github.com/electron-userland/electron-builder) to create distributable packages.
#### Run the web app for development
`yarn compile:web` (this is only needed the first time you run the app)
`yarn dev:web`
- This uses webpack-dev-server and includes hot-reloading. If you want to debug the [web server we use in production](https://github.com/lbryio/lbry-desktop/blob/master/src/platforms/web/server.js) you can run `yarn dev:web-server`. This starts a server at `localhost:1337` and does not include hot reloading.
@@ -110,11 +106,12 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
cp .env.defaults .env
nano .env
```
- To specify your own OG-IMAGE
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
- To specify your own channels to be followed on first run
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
- If you want to customize the homepage content
@@ -132,7 +129,7 @@ PINNED_LABEL_2=OtherLinkText
```
- Finally `NODE_ENV=production yarn compile:web` to rebuild
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
#### Deploy the web app (_experimental_)
@@ -173,8 +170,9 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it. All releases are signed by [Sean Yesmunt](https://keybase.io/seanyesmunt/key.asc).
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it. Previous versions up to v0.50.2 were signed by [Sean Yesmunt](https://keybase.io/seanyesmunt/key.asc).
New Releases are signed by [Jessop Breth](https://keybase.io/jessopb/key.asc).
## Contact
The primary contact for this project is [@seanyesmunt](https://github.com/seanyesmunt).
The primary contact for this project is [@jessopb](https://github.com/jessopb).
+31 -2
View File
@@ -8,11 +8,15 @@ const config = {
WEBPACK_WEB_PORT: process.env.WEBPACK_WEB_PORT,
WEBPACK_ELECTRON_PORT: process.env.WEBPACK_ELECTRON_PORT,
WEB_SERVER_PORT: process.env.WEB_SERVER_PORT,
LBRY_WEB_API: process.env.LBRY_WEB_API, //api.lbry.tv',
LBRY_WEB_API: process.env.LBRY_WEB_API, //api.na-backend.odysee.com',
LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API,
LBRY_API_URL: process.env.LBRY_API_URL, //api.lbry.com',
LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, //cdn.lbryplayer.xyz',
LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API,
SEARCH_SERVER_API: process.env.SEARCH_SERVER_API,
COMMENT_SERVER_API: process.env.COMMENT_SERVER_API,
COMMENT_SERVER_NAME: process.env.COMMENT_SERVER_NAME,
SOCKETY_SERVER_API: process.env.SOCKETY_SERVER_API,
WELCOME_VERSION: process.env.WELCOME_VERSION,
DOMAIN: process.env.DOMAIN,
SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL,
@@ -22,20 +26,38 @@ const config = {
SITE_NAME: process.env.SITE_NAME,
SITE_DESCRIPTION: process.env.SITE_DESCRIPTION,
SITE_HELP_EMAIL: process.env.SITE_HELP_EMAIL,
// SOCIAL MEDIA
TWITTER_ACCOUNT: process.env.TWITTER_ACCOUNT,
// LOGO
LOGO_TITLE: process.env.LOGO_TITLE,
FAVICON: process.env.FAVICON,
LOGO: process.env.LOGO,
LOGO_TEXT_LIGHT: process.env.LOGO_TEXT_LIGHT,
LOGO_TEXT_DARK: process.env.LOGO_TEXT_DARK,
AVATAR_DEFAULT: process.env.AVATAR_DEFAULT,
// OG
OG_TITLE_SUFFIX: process.env.OG_TITLE_SUFFIX,
OG_HOMEPAGE_TITLE: process.env.OG_HOMEPAGE_TITLE,
OG_IMAGE_URL: process.env.OG_IMAGE_URL,
// MASCOT
YRBL_HAPPY_IMG_URL: process.env.YRBL_HAPPY_IMG_URL,
YRBL_SAD_IMG_URL: process.env.YRBL_SAD_IMG_URL,
LOGIN_IMG_URL: process.env.LOGIN_IMG_URL,
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
UNSYNCED_SETTINGS: process.env.UNSYNCED_SETTINGS,
// ENABLE FEATURES
ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true',
ENABLE_FILE_REACTIONS: process.env.ENABLE_FILE_REACTIONS === 'true',
ENABLE_CREATOR_REACTIONS: process.env.ENABLE_CREATOR_REACTIONS === 'true',
ENABLE_NO_SOURCE_CLAIMS: process.env.ENABLE_NO_SOURCE_CLAIMS === 'true',
ENABLE_PREROLL_ADS: process.env.ENABLE_PREROLL_ADS === 'true',
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: process.env.CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS,
CHANNEL_STAKED_LEVEL_LIVESTREAM: process.env.CHANNEL_STAKED_LEVEL_LIVESTREAM,
WEB_PUBLISH_SIZE_LIMIT_GB: process.env.WEB_PUBLISH_SIZE_LIMIT_GB,
LOADING_BAR_COLOR: process.env.LOADING_BAR_COLOR,
SIMPLE_SITE: process.env.SIMPLE_SITE === 'true',
SHOW_ADS: process.env.SHOW_ADS === 'true',
PINNED_URI_1: process.env.PINNED_URI_1,
@@ -43,9 +65,16 @@ const config = {
PINNED_URI_2: process.env.PINNED_URI_2,
PINNED_LABEL_2: process.env.PINNED_LABEL_2,
KNOWN_APP_DOMAINS: process.env.KNOWN_APP_DOMAINS ? process.env.KNOWN_APP_DOMAINS.split(',') : [],
STRIPE_PUBLIC_KEY: process.env.STRIPE_PUBLIC_KEY,
ENABLE_UI_NOTIFICATIONS: process.env.ENABLE_UI_NOTIFICATIONS === 'true',
ENABLE_MATURE: process.env.ENABLE_MATURE === 'true',
CUSTOM_HOMEPAGE: process.env.CUSTOM_HOMEPAGE === 'true',
SHOW_TAGS_INTRO: process.env.SHOW_TAGS_INTRO === 'true',
LIGHTHOUSE_DEFAULT_TYPES: process.env.LIGHTHOUSE_DEFAULT_TYPES,
BRANDED_SITE: process.env.BRANDED_SITE,
};
config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`;
config.URL_DEV = `http://localhost:${config.WEBPACK_WEB_PORT}`;
config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`;
module.exports = config;
+17 -5
View File
@@ -45,9 +45,15 @@ let daemon;
let lbryFirst;
const appState = {};
const PROTOCOL = 'lbry';
if (process.platform !== 'linux') {
app.setAsDefaultProtocolClient('lbry');
if (isDev && process.platform === 'win32') {
// Setting this is required to get this working in dev mode.
app.setAsDefaultProtocolClient(PROTOCOL, process.execPath, [
path.resolve(process.argv[1]),
]);
} else {
app.setAsDefaultProtocolClient(PROTOCOL);
}
app.name = 'LBRY';
@@ -149,9 +155,15 @@ if (!gotSingleInstanceLock) {
app.on('second-instance', (event, argv) => {
// Send the url to the app to navigate first, then focus
if (rendererWindow) {
if ((process.platform === 'win32' || process.platform === 'linux') && String(argv[1]).startsWith('lbry')) {
let URI = argv[1];
// External uri (last item on argv):
const EXTERNAL_URI = (argv.length) ? argv[argv.length - 1] : '';
// Handle protocol requests for windows and linux
const platforms = (process.platform === 'win32' || process.platform === 'linux');
// Is LBRY protocol
const isProtocolURI = String(EXTERNAL_URI).startsWith(PROTOCOL + '://');
// External protocol requested:
if (platforms && isProtocolURI) {
let URI = EXTERNAL_URI;
// Keep only command line / deep linked arguments
// Windows normalizes URIs when they're passed in from other apps. On Windows, this tries to
// restore the original URI that was typed.
+211 -6
View File
@@ -12,25 +12,56 @@ declare type Comment = {
is_channel_signature_valid?: boolean, // whether or not the signature could be validated
parent_id?: number, // comment_id of comment this is in reply to
is_pinned: boolean,
support_amount: number,
replies: number, // number of direct replies (i.e. excluding nested replies).
is_fiat?: boolean,
};
declare type PerChannelSettings = {
words?: Array<string>,
comments_enabled?: boolean,
min_tip_amount_comment?: number,
min_tip_amount_super_chat?: number,
slow_mode_min_gap?: number,
};
// todo: relate individual comments to their commentId
declare type CommentsState = {
commentsByUri: { [string]: string },
byId: { [string]: Array<string> },
repliesByParentId: { [string]: Array<string> }, // ParentCommentID -> list of reply comments
topLevelCommentsById: { [string]: Array<string> }, // ClaimID -> list of top level comments
superChatsByUri: { [string]: { totalAmount: number, comments: Array<Comment> } },
byId: { [string]: Array<string> }, // ClaimID -> list of fetched comment IDs.
totalCommentsById: {}, // ClaimId -> ultimate total (including replies) in commentron.
repliesByParentId: { [string]: Array<string> }, // ParentCommentID -> list of fetched replies.
totalRepliesByParentId: {}, // ParentCommentID -> total replies in commentron.
topLevelCommentsById: { [string]: Array<string> }, // ClaimID -> list of fetched top level comments.
topLevelTotalPagesById: { [string]: number }, // ClaimID -> total number of top-level pages in commentron. Based on COMMENT_PAGE_SIZE_TOP_LEVEL.
topLevelTotalCommentsById: { [string]: number }, // ClaimID -> total top level comments in commentron.
commentById: { [string]: Comment },
linkedCommentAncestors: { [string]: Array<string> }, // {"linkedCommentId": ["parentId", "grandParentId", ...]}
pinnedCommentsById: {}, // ClaimId -> array of pinned comment IDs
isLoading: boolean,
isLoadingByParentId: { [string]: boolean },
myComments: ?Set<string>,
isFetchingReacts: boolean,
myReactsByCommentId: any,
othersReactsByCommentId: any,
myReactsByCommentId: ?{ [string]: Array<string> }, // {"CommentId:MyChannelId": ["like", "dislike", ...]}
othersReactsByCommentId: ?{ [string]: { [string]: number } }, // {"CommentId:MyChannelId": {"like": 2, "dislike": 2, ...}}
pendingCommentReactions: Array<string>,
moderationBlockList: ?Array<string>,
moderationBlockList: ?Array<string>, // @KP rename to "personalBlockList"?
adminBlockList: ?Array<string>,
moderatorBlockList: ?Array<string>,
moderatorBlockListDelegatorsMap: {[string]: Array<string>}, // {"blockedUri": ["delegatorUri1", ""delegatorUri2", ...]}
fetchingModerationBlockList: boolean,
moderationDelegatesById: { [string]: Array<{ channelId: string, channelName: string }> },
fetchingModerationDelegates: boolean,
moderationDelegatorsById: { [string]: { global: boolean, delegators: { name: string, claimId: string } }},
fetchingModerationDelegators: boolean,
blockingByUri: {},
unBlockingByUri: {},
togglingForDelegatorMap: {[string]: Array<string>}, // {"blockedUri": ["delegatorUri1", ""delegatorUri2", ...]}
commentsDisabledChannelIds: Array<string>,
settingsByChannelId: { [string]: PerChannelSettings }, // ChannelID -> settings
fetchingSettings: boolean,
fetchingBlockedWords: boolean,
};
declare type CommentReactParams = {
@@ -41,3 +72,177 @@ declare type CommentReactParams = {
clear_types?: string,
remove?: boolean,
};
declare type ReactionReactParams = {
comment_ids: string,
signature?: string,
signing_ts?: string,
remove?: boolean,
clear_types?: string,
type: string,
channel_id: string,
channel_name: string,
};
declare type ReactionReactResponse = {
Reactions: { [string]: { [string]: number} },
};
declare type ReactionListParams = {
comment_ids: string, // CSV of IDs
channel_id?: string,
channel_name?: string,
signature?: string,
signing_ts?: string,
types?: string,
};
declare type ReactionListResponse = {
my_reactions: Array<MyReactions>,
others_reactions: Array<OthersReactions>,
};
declare type CommentListParams = {
page: number, // pagination: which page of results
page_size: number, // pagination: nr of comments to show in a page (max 200)
claim_id: string, // claim id of claim being commented on
channel_name?: string, // signing channel name of claim (enables 'commentsEnabled' check)
channel_id?: string, // signing channel claim id of claim (enables 'commentsEnabled' check)
author_claim_id?: string, // filters comments to just this author
parent_id?: string, // filters comments to those under this thread
top_level?: boolean, // filters to only top level comments
hidden?: boolean, // if true, will show hidden comments as well
sort_by?: number, // NEWEST=0, OLDEST=1, CONTROVERSY=2, POPULARITY=3,
};
declare type CommentListResponse = {
items: Array<Comment>,
page: number,
page_size: number,
total_items: number, // Grand total for the claim being commented on.
total_filtered_items: number, // Total for filtered queries (e.g. top_level=true, parent_id=xxx, etc.).
total_pages: number,
has_hidden_comments: boolean,
};
declare type CommentByIdParams = {
comment_id: string,
with_ancestors: boolean,
}
declare type CommentByIdResponse = {
item: Comment,
items: Comment,
ancestors: Array<Comment>,
}
declare type CommentPinParams = {
comment_id: string,
channel_id: string,
channel_name: string,
remove?: boolean,
signature: string,
signing_ts: string,
}
declare type CommentPinResponse = {
items: Comment, // "items" is an inherited typo to match SDK. Will be "item" in a new version.
}
declare type CommentEditParams = {
comment: string,
comment_id: string,
signature: string,
signing_ts: string,
}
declare type CommentEditResponse = Comment
declare type CommentAbandonParams = {
comment_id: string,
creator_channel_id?: string,
creator_channel_name?: string,
channel_id?: string,
hexdata?: string,
};
declare type CommentCreateParams = {
comment: string,
claim_id: string,
parent_id?: string,
signature: string,
signing_ts: number,
support_tx_id?: string,
};
declare type SuperListParams = {};
declare type SuperListResponse = {
page: number,
page_size: number,
total_pages: number,
total_items: number,
total_amount: number,
items: Array<Comment>,
has_hidden_comments: boolean,
};
declare type ModerationBlockParams = {};
declare type ModerationAddDelegateParams = {
mod_channel_id: string,
mod_channel_name: string,
creator_channel_id: string,
creator_channel_name: string,
signature: string,
signing_ts: string,
};
declare type ModerationRemoveDelegateParams = {
mod_channel_id: string,
mod_channel_name: string,
creator_channel_id: string,
creator_channel_name: string,
signature: string,
signing_ts: string,
};
declare type ModerationListDelegatesParams = {
creator_channel_id: string,
creator_channel_name: string,
signature: string,
signing_ts: string,
};
declare type ModerationAmIParams = {
channel_name: string,
channel_id: string,
signature: string,
signing_ts: string
};
declare type SettingsParams = {
channel_name: string,
channel_id: string,
signature: string,
signing_ts: string,
};
declare type UpdateSettingsParams = {
channel_name: string,
channel_id: string,
signature: string,
signing_ts: string,
comments_enabled?: boolean,
min_tip_amount_comment?: number,
min_tip_amount_super_chat?: number,
slow_mode_min_gap?: number,
}
declare type BlockWordParams = {
channel_name: string,
channel_id: string,
signature: string,
signing_ts: string,
words: string, // CSV list of containing words to block comment on content
};
-16
View File
@@ -1,16 +0,0 @@
// @flow
declare type CommentListParams = {
page: number,
page_size: number,
claim_id: string,
};
declare type CommentAbandonParams = {
comment_id: string,
creator_channel_id?: string,
creator_channel_name?: string,
channel_id?: string,
hexdata?: string,
};
declare type ModerationBlockParams = {};
+5 -3
View File
@@ -4,12 +4,12 @@ declare type HomepageObject = {
options: any,
route: string,
title: string,
}
};
declare type HomepageData = {
[string]: HomepageObject,
default: any => any,
}
};
declare type RowDataItem = {
title: any,
@@ -17,9 +17,11 @@ declare type RowDataItem = {
help?: any,
icon?: string,
extra?: any,
pinnedUrls?: Array<string>,
options?: {
channelIds?: Array<string>,
pageSize: number,
limitClaimsPerChannel?: number,
pageSize?: number,
},
route?: string,
hideForUnauth?: boolean,
+27
View File
@@ -0,0 +1,27 @@
// @flow
declare type LivestreamReplayItem = {
data: {
claimId: string,
deleted: boolean,
deletedAt: ?string,
ffprobe: any,
fileDuration: number, // decimal? float? string?
fileType: string,
fileLocation: string,
fileSize: number,
key: string,
published: boolean,
publishedAt: ?string,
service: string,
thumbnails: Array<string>,
uploadedAt: string, // Date?
},
id: string,
}
declare type LivestreamReplayData = Array<LivestreamReplayItem>;
declare type LivestreamState = {
fetchingById: {},
viewersById: {},
}
+5
View File
@@ -36,3 +36,8 @@ declare type WebNotification = {
user_id: number,
group_count?: number,
};
declare type NotificationCategory = {
name: string,
types: ?Array<string>,
};
+1
View File
@@ -11,6 +11,7 @@ declare type UpdatePublishFormData = {
thumbnail_url?: string,
uploadThumbnailStatus?: string,
thumbnailPath?: string,
thumbnailError?: boolean,
description?: string,
language?: string,
channel?: string,
+9
View File
@@ -0,0 +1,9 @@
// @flow
import * as ACTIONS from 'constants/action_types';
declare type ReportContentState = {
isReporting: boolean,
error: string,
};
+13
View File
@@ -14,11 +14,22 @@ declare type SearchOptions = {
MEDIA_TEXT: string,
MEDIA_IMAGE: string,
MEDIA_APPLICATION: string,
SORT: string,
SORT_ACCENDING: string,
SORT_DESCENDING: string,
EXACT: string,
TIME_FILTER: string,
TIME_FILTER_LAST_HOUR: string,
TIME_FILTER_TODAY: string,
TIME_FILTER_THIS_WEEK: string,
TIME_FILTER_THIS_MONTH: string,
TIME_FILTER_THIS_YEAR: string,
};
declare type SearchState = {
options: SearchOptions,
urisByQuery: {},
hasReachedMaxResultsLength: {},
searching: boolean,
};
@@ -26,6 +37,8 @@ declare type SearchSuccess = {
type: ACTIONS.SEARCH_SUCCESS,
data: {
query: string,
from: number,
size: number,
uris: Array<string>,
},
};
-11
View File
@@ -1,15 +1,4 @@
// @flow
import * as ACTIONS from 'constants/action_types';
import {
DOWNLOADED,
DOWNLOADING,
NOTIFY_ONLY,
VIEW_ALL,
VIEW_LATEST_FIRST,
SUGGESTED_TOP_BID,
SUGGESTED_TOP_SUBSCRIBED,
SUGGESTED_FEATURED,
} from 'constants/subscriptions';
declare type Subscription = {
channelName: string, // @CryptoCandor,
+4
View File
@@ -28,4 +28,8 @@ declare type User = {
device_types: Array<DeviceType>,
lbry_first_approved: boolean,
experimental_ui: boolean,
fiat_enabled: boolean,
odysee_live_enabled: boolean,
odysee_live_disabled: boolean,
global_mod: boolean,
};
+16 -181
View File
@@ -1,38 +1,7 @@
// @flow
import * as PAGES from 'constants/pages';
import * as ICONS from 'constants/icons';
import * as CS from 'constants/claim_search';
import { parseURI } from 'lbry-redux';
import moment from 'moment';
import { toCapitalCase } from 'util/string';
import { useIsLargeScreen } from 'effects/use-screensize';
import * as PAGES from '../ui/constants/pages';
import * as CS from '../ui/constants/claim_search';
export type RowDataItem = {
title: string,
link?: string,
help?: any,
options?: {},
icon?: string,
};
export default function GetHomePageRowData(
authenticated: boolean,
showPersonalizedChannels: boolean,
showPersonalizedTags: boolean,
subscribedChannels: Array<Subscription>,
followedTags: Array<Tag>,
showIndividualTags: boolean,
showNsfw: boolean
) {
const isLargeScreen = useIsLargeScreen();
function getPageSize(originalSize) {
return isLargeScreen ? originalSize * (3 / 2) : originalSize;
}
let rowData: Array<RowDataItem> = [];
const individualTagDataItems: Array<RowDataItem> = [];
const YOUTUBER_CHANNEL_IDS = [
const YOUTUBER_CHANNEL_IDS = [
'fb364ef587872515f545a5b4b3182b58073f230f',
'589276465a23c589801d874f484cc39f307d7ec7',
'ba79c80788a9e1751e49ad401f5692d86f73a2db',
@@ -116,152 +85,18 @@ export default function GetHomePageRowData(
'e8f68563d242f6ac9784dcbc41dd86c28a9391d6',
];
const YOUTUBE_CREATOR_ROW = {
title: __('CableTube Escape Artists'),
link: `/$/${PAGES.DISCOVER}?${CS.CLAIM_TYPE}=${CS.CLAIM_STREAM}&${CS.CHANNEL_IDS_KEY}=${YOUTUBER_CHANNEL_IDS.join(
','
)}`,
options: {
claimType: ['stream'],
orderBy: ['release_time'],
pageSize: getPageSize(12),
channelIds: YOUTUBER_CHANNEL_IDS,
limitClaimsPerChannel: 1,
releaseTime: `>${Math.floor(moment().subtract(1, 'months').startOf('week').unix())}`,
},
const YOUTUBERS = {
ids: YOUTUBER_CHANNEL_IDS,
link: `/$/${PAGES.DISCOVER}?${CS.CLAIM_TYPE}=${CS.CLAIM_STREAM}&${CS.CHANNEL_IDS_KEY}=${YOUTUBER_CHANNEL_IDS.join(
','
)}`,
name: 'general',
label: 'CableTube Escape Artists',
channelLimit: 1,
daysOfContent: 30,
pageSize: 24,
//pinnedUrls: [],
//mixIn: [],
};
if (followedTags.length) {
followedTags.forEach((tag: Tag) => {
const tagName = `#${toCapitalCase(tag.name)}`;
individualTagDataItems.push({
title: __('Trending for %tagName%', { tagName: tagName }),
link: `/$/${PAGES.DISCOVER}?t=${tag.name}`,
options: {
pageSize: 4,
tags: [tag.name],
claimType: ['stream'],
},
});
});
}
const RECENT_FROM_FOLLOWING = {
title: __('Recent From Following'),
link: `/$/${PAGES.CHANNELS_FOLLOWING}`,
icon: ICONS.SUBSCRIBE,
options: {
orderBy: ['release_time'],
releaseTime:
subscribedChannels.length > 20
? `>${Math.floor(moment().subtract(6, 'months').startOf('week').unix())}`
: `>${Math.floor(moment().subtract(1, 'year').startOf('week').unix())}`,
pageSize: getPageSize(subscribedChannels.length > 3 ? (subscribedChannels.length > 6 ? 16 : 8) : 4),
channelIds: subscribedChannels.map((subscription: Subscription) => {
const { channelClaimId } = parseURI(subscription.uri);
return channelClaimId;
}),
},
};
const TOP_CONTENT_TODAY = {
title: __('Top Content from Today'),
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_DAY}`,
options: {
pageSize: getPageSize(showPersonalizedChannels || showPersonalizedTags ? 4 : 8),
orderBy: ['effective_amount'],
claimType: ['stream'],
limitClaimsPerChannel: 2,
releaseTime: `>${Math.floor(moment().subtract(1, 'day').startOf('day').unix())}`,
},
};
const TOP_CHANNELS = {
title: __('Top Channels On LBRY'),
link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
options: {
orderBy: ['effective_amount'],
claimType: ['channel'],
},
};
// const TRENDING_CLASSICS = {
// title: __('Trending Classics'),
// link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`,
// options: {
// pageSize: getPageSize(4),
// claimType: ['stream'],
// limitClaimsPerChannel: 1,
// releaseTime: `<${Math.floor(
// moment()
// .subtract(6, 'month')
// .startOf('day')
// .unix()
// )}`,
// },
// };
// const TRENDING_ON_LBRY = {
// title: __('Trending On LBRY'),
// link: `/$/${PAGES.DISCOVER}`,
// options: {
// pageSize: showPersonalizedChannels || showPersonalizedTags ? 4 : 8,
// },
// };
const TRENDING_FOR_TAGS = {
title: __('Trending For Your Tags'),
link: `/$/${PAGES.TAGS_FOLLOWING}`,
icon: ICONS.TAG,
options: {
pageSize: getPageSize(4),
tags: followedTags.map((tag) => tag.name),
claimType: ['stream'],
limitClaimsPerChannel: 2,
},
};
const LATEST_FROM_LBRY = {
title: __('Latest From @lbry'),
link: `/@lbry:3f`,
options: {
orderBy: ['release_time'],
pageSize: getPageSize(4),
channelIds: ['3fda836a92faaceedfe398225fb9b2ee2ed1f01a'],
},
};
const LATEST_FROM_LBRYCAST = {
title: __('Latest From @lbrycast'),
link: `/@lbrycast:4`,
options: {
orderBy: ['release_time'],
pageSize: getPageSize(4),
channelIds: ['4c29f8b013adea4d5cca1861fb2161d5089613ea'],
},
};
if (showPersonalizedChannels) rowData.push(RECENT_FROM_FOLLOWING);
if (showPersonalizedTags && !showIndividualTags) rowData.push(TRENDING_FOR_TAGS);
if (showPersonalizedTags && showIndividualTags) {
individualTagDataItems.forEach((item: RowDataItem) => {
rowData.push(item);
});
}
if (!authenticated) {
rowData.push(YOUTUBE_CREATOR_ROW);
}
rowData.push(TOP_CONTENT_TODAY);
// rowData.push(TRENDING_ON_LBRY);
rowData.push(LATEST_FROM_LBRY);
rowData.push(LATEST_FROM_LBRYCAST);
if (!showPersonalizedChannels) rowData.push(TOP_CHANNELS);
return rowData;
}
module.exports = { YOUTUBERS };
+3 -5
View File
@@ -1,5 +1,3 @@
import * as lbrytv from './homepage';
// import all homepages
// export object of homepages
export default {'en': lbrytv};
export const NO_ADS_CHANNEL_IDS = [];
module.exports = {
en: {},
};
+4
View File
@@ -0,0 +1,4 @@
module.exports = {
text: `This is LBRY`,
url: 'https://odysee.com/@Odysee:8?view=discussion',
};
+19 -7
View File
@@ -1,6 +1,6 @@
{
"name": "lbry",
"version": "0.49.4",
"version": "0.51.2-rc.1",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"keywords": [
"lbry"
@@ -20,10 +20,11 @@
},
"main": "./dist/electron/main.js",
"scripts": {
"analyze": "source-map-explorer --only-mapped dist/electron/webpack/ui*.js --html dist/sourceMap.html",
"compile:electron": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.electron.config.js",
"compile:web": "yarn copyenv && cd web && node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.config.js",
"compile": "cross-env NODE_ENV=production yarn compile:electron && cross-env NODE_ENV=production yarn compile:web",
"copyenv": "cp ./.env* web/",
"copyenv": "copyfiles ./.env* web/",
"dev": "yarn dev:electron",
"dev:electron": "cross-env NODE_ENV=development node ./electron/devServer.js",
"dev:web": "yarn copyenv && cd web && yarn dev",
@@ -37,6 +38,7 @@
"build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null",
"crossenv": "./node_modules/cross-env/dist/bin/cross-env",
"lint": "eslint 'ui/**/*.{js,jsx}' && eslint 'web/**/*.{js,jsx}' && eslint 'electron/**/*.js' && flow",
"lint-fix": "eslint --fix --quiet 'ui/**/*.{js,jsx}' && eslint --fix --quiet 'web/**/*.{js,jsx}' && eslint --fix --quiet 'electron/**/*.js'",
"format": "prettier 'src/**/*.{js,jsx,scss,json}' --write",
"flow-defs": "flow-typed install",
"precommit": "lint-staged",
@@ -53,8 +55,15 @@
"electron-updater": "^4.2.4",
"express": "^4.17.1",
"if-env": "^1.0.4",
"react-datetime-picker": "^3.2.1",
"react-plastic": "^1.1.1",
"react-top-loading-bar": "^2.0.1",
"remove-markdown": "^0.3.0",
"rss": "^1.2.2",
"source-map-explorer": "^2.5.2",
"tempy": "^0.6.0",
"videojs-contrib-ads": "^6.9.0",
"videojs-ima": "^1.11.0",
"videojs-logo": "^2.1.4"
},
"devDependencies": {
@@ -98,6 +107,7 @@
"concurrently": "^4.1.2",
"connected-react-router": "^6.8.0",
"copy-webpack-plugin": "^5.1.2",
"copyfiles": "^2.4.1",
"country-data": "^0.0.31",
"cross-env": "^7.0.3",
"crypto-js": "^4.0.0",
@@ -142,8 +152,8 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#bf728f8716385749370de9a1edee50b267d61fa4",
"lbryinc": "lbryio/lbryinc#7faea40d87b78ec91b901c62f501499dc4737025",
"lbry-redux": "lbryio/lbry-redux#e4d0662100a5f4b28bb1bf3cbc1e51b2eebab5b6",
"lbryinc": "lbryio/lbryinc#8f9a58bfc8312a65614fd7327661cdcc502c4e59",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",
@@ -153,6 +163,7 @@
"node-fetch": "^2.6.1",
"node-libs-browser": "^2.1.0",
"node-loader": "^0.6.0",
"node-wget": "^0.4.3",
"nodemon": "^1.19.1",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
@@ -203,7 +214,8 @@
"tree-kill": "^1.1.0",
"unist-util-visit": "^2.0.3",
"uuid": "^8.3.2",
"video.js": "^7.10.1",
"vast-client": "^3.1.1",
"video.js": "^7.13.3",
"videojs-contrib-quality-levels": "^2.0.9",
"videojs-event-tracking": "^1.0.1",
"villain-react": "^1.0.9",
@@ -217,7 +229,7 @@
"webpack-hot-middleware": "^2.24.3",
"webpack-merge": "^4.2.1",
"webpack-node-externals": "^1.7.2",
"y18n": "^4.0.0",
"y18n": "^4.0.1",
"yarnhook": "^0.2.0"
},
"engines": {
@@ -225,7 +237,7 @@
"yarn": "^1.3"
},
"lbrySettings": {
"lbrynetDaemonVersion": "0.88.0",
"lbrynetDaemonVersion": "0.99.0",
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
"lbrynetDaemonDir": "static/daemon",
"lbrynetDaemonFileName": "lbrynet",
+525 -48
View File
@@ -48,7 +48,6 @@
"Description of your content": "Description of your content",
"Price": "Price",
"Free": "Free",
"The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).": "The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).",
"Learn more": "Learn more",
"Name": "Name",
"Deposit": "Deposit",
@@ -115,6 +114,7 @@
"Recipient address": "Recipient address",
"Send": "Send",
"Receive Credits": "Receive Credits",
"Send Credits": "Send Credits",
"Address copied.": "Address copied.",
"Get New Address": "Get New Address",
"Show QR code": "Show QR code",
@@ -173,9 +173,7 @@
"Yes": "Yes",
"No": "No",
"These search results are provided by LBRY, Inc.": "These search results are provided by LBRY, Inc.",
"FILTER": "FILTER",
"View file": "View file",
"Search For": "Search For",
"Files": "Files",
"Channels": "Channels",
"Everything": "Everything",
@@ -184,6 +182,16 @@
"Other": "Other",
"Other Options": "Other Options",
"Returned Results": "Returned Results",
"Find results that include all the given words in the exact order.\nThis can also be done by surrounding the search query with quotation marks (e.g. \"hello world\").": "Find results that include all the given words in the exact order.\nThis can also be done by surrounding the search query with quotation marks (e.g. \"hello world\").",
"Last Hour": "Last Hour",
"Last 24 Hours": "Last 24 Hours",
"Relevance": "Relevance",
"Newest first": "Newest first",
"Oldest first": "Oldest first",
"Exact match": "Exact match",
"Upload Date": "Upload Date",
"Creation Date": "Creation Date",
"Sort By": "Sort By",
"Custom Code": "Custom Code",
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
"Go To Invites": "Go To Invites",
@@ -197,9 +205,11 @@
"Connecting...": "Connecting...",
"Comments": "Comments",
"Comment": "Comment",
"Comment --[button to submit something]--": "Comment",
"Your comment": "Your comment",
"Post --[button to submit something]--": "Post",
"Post --[noun, markdown post tab button]--": "Post",
"Livestream --[noun, livestream tab button]--": "Livestream",
"Posting...": "Posting...",
"Incompatible daemon": "Incompatible daemon",
"Incompatible daemon running": "Incompatible daemon running",
@@ -300,6 +310,9 @@
"upload": "upload",
"Uploading thumbnail": "Uploading thumbnail",
"Please wait for thumbnail to finish uploading": "Please wait for thumbnail to finish uploading",
"A thumbnail is required. Please upload or provide an image URL above.": "A thumbnail is required. Please upload or provide an image URL above.",
"Thumbnail is invalid.": "Thumbnail is invalid.",
"Please reselect a file after changing the LBRY URL": "Please reselect a file after changing the LBRY URL",
"API connection string": "API connection string",
"Method": "Method",
"Parameters": "Parameters",
@@ -316,13 +329,14 @@
"This file is downloaded.": "This file is downloaded.",
"Featured content. Earn rewards for watching.": "Featured content. Earn rewards for watching.",
"You are subscribed to this channel.": "You are subscribed to this channel.",
"Your settings.": "Your settings.",
"Remove from your library": "Remove from your library",
"View tag": "View tag",
"Customize Your Tags": "Customize Your Tags",
"Remove tag": "Remove tag",
"Add tag": "Add tag",
"No tags added": "No tags added",
"Choose a thumbnail": "Choose a thumbnail",
"Choose an enticing thumbnail": "Choose an enticing thumbnail",
"Take a snapshot from your video": "Take a snapshot from your video",
"Upload your thumbnail to": "Upload your thumbnail to",
"Add a price to this file": "Add a price to this file",
@@ -362,6 +376,8 @@
"Got it": "Got it",
"View your channels": "View your channels",
"Unfollow": "Unfollow",
"Follow @%channelName%": "Follow @%channelName%",
"Unfollow @%channelName%": "Unfollow @%channelName%",
"These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.": "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.",
"Create channel": "Create channel",
"Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.",
@@ -371,22 +387,25 @@
"Email Us": "Email Us",
"Today": "Today",
"All time": "All time",
"Share on Reddit": "Share on Reddit",
"Share on Facebook": "Share on Facebook",
"Share On Twitter": "Share On Twitter",
"Share on Twitter": "Share on Twitter",
"Share on Telegram": "Share on Telegram",
"Share via...": "Share via...",
"View on lbry.tv": "View on lbry.tv",
"You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.": "You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.",
"Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?": "Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?",
"You currently have the highest bid for this name.": "You currently have the highest bid for this name.",
"You can generate a new address at any time, and any previous addresses will continue to work.": "You can generate a new address at any time, and any previous addresses will continue to work.",
"Confirm Claim Revoke": "Confirm Claim Revoke",
"Confirm Removal": "Confirm Removal",
"Confirm Tip Unlock": "Confirm Tip Unlock",
"Confirm Support Revoke": "Confirm Support Revoke",
"Are you sure you want to remove this support?": "Are you sure you want to remove this support?",
"These Credits are permanently yours and can be removed at any time. Removing this support will reduce the claim's discoverability and return the %lbc% to your spendable balance.": "These Credits are permanently yours and can be removed at any time. Removing this support will reduce the claim's discoverability and return the %lbc% to your spendable balance.",
"Confirm Channel Removal": "Confirm Channel Removal",
"Confirm Support Removal": "Confirm Support Removal",
"Are you sure you want to remove this boost?": "Are you sure you want to remove this boost?",
"These Credits are permanently yours and this boost can be removed at any time. Removing this boost will reduce discoverability and return %lbc% to your spendable balance.": "These Credits are permanently yours and this boost can be removed at any time. Removing this boost will reduce discoverability and return %lbc% to your spendable balance.",
"Are you sure you want to unlock these Credits?": "Are you sure you want to unlock these Credits?",
"These Credits are permanently yours and can be unlocked at any time. Unlocking them allows you to spend them, but can hurt the performance of your content in lookups and search results. It is recommended you leave tips locked until you need or want to spend them.": "These Credits are permanently yours and can be unlocked at any time. Unlocking them allows you to spend them, but can hurt the performance of your content in lookups and search results. It is recommended you leave tips locked until you need or want to spend them.",
"Are you sure you want to revoke this claim?": "Are you sure you want to revoke this claim?",
"This will prevent others from resolving and accessing the content you published. It will return the %lbc% to your spendable balance, less a small transaction fee.": "This will prevent others from resolving and accessing the content you published. It will return the %lbc% to your spendable balance, less a small transaction fee.",
"These Credits are permanently yours and can be unlocked at any time. Unlocking them allows you to spend them, but reduces discoverability of your content in lookups and search results. It is recommended you leave Credits locked until you need or want to spend them.": "These Credits are permanently yours and can be unlocked at any time. Unlocking them allows you to spend them, but reduces discoverability of your content in lookups and search results. It is recommended you leave Credits locked until you need or want to spend them.",
"Are you sure you want to remove this?": "Are you sure you want to remove this?",
"This will prevent others from resolving and accessing the content you published. It will return the %lbc% to your spendable balance.": "This will prevent others from resolving and accessing the content you published. It will return the %lbc% to your spendable balance.",
"Mature": "Mature",
"Show mature content": "Show mature content",
"Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ": "Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ",
@@ -423,6 +442,9 @@
"Redeem a custom reward code for": "Redeem a custom reward code for",
"Redeem": "Redeem",
"Code": "Code",
"reward code not found": "reward code not found",
"reward code required": "reward code required",
"this code has expired": "this code has expired",
"Nothing here": "Nothing here",
"Upload something and claim this spot!": "Upload something and claim this spot!",
"File Size": "File Size",
@@ -432,13 +454,13 @@
"Trending": "Trending",
"Top": "Top",
"New": "New",
"New --[clears Publish Form]--": "New",
"Loading": "Loading",
"This file is in your library.": "This file is in your library.",
"'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.": "'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.",
"Invalid claim ID %s.": "Invalid claim ID %s.",
"'claimId' should no longer be used. Use 'streamClaimId' or 'channelClaimId' instead": "'claimId' should no longer be used. Use 'streamClaimId' or 'channelClaimId' instead",
"View Tag": "View Tag",
"Block": "Block",
"'claimName' should no longer be used. Use 'streamClaimName' or 'channelClaimName' instead": "'claimName' should no longer be used. Use 'streamClaimName' or 'channelClaimName' instead",
"Vietnamese": "Vietnamese",
"Thai": "Thai",
@@ -469,6 +491,7 @@
"Blocked and muted channels": "Blocked and muted channels",
"Manage": "Manage",
"Automatic dark mode": "Automatic dark mode",
"24-hour clock": "24-hour clock",
"Hide wallet balance in header": "Hide wallet balance in header",
"Max Connections": "Max Connections",
"For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.": "For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.",
@@ -481,6 +504,7 @@
"From --[the tip sender]--": "From",
"From --[initial time]--": "From",
"Not enough Credits": "Not enough Credits",
"Decrease amount to account for transaction fee": "Decrease amount to account for transaction fee",
"You have %credit_amount% in unclaimed rewards.": "You have %credit_amount% in unclaimed rewards.",
"In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.": "In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.",
"Read More": "Read More",
@@ -526,7 +550,6 @@
"Extra Verification Needed": "Extra Verification Needed",
"We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.": "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.",
"Verify phone number": "Verify phone number",
"Verify Phone Number": "Verify Phone Number",
"OR": "OR",
"Proof via Credit": "Proof via Credit",
"If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.": "If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.",
@@ -601,7 +624,9 @@
"Looks like you don't have any transactions.": "Looks like you don't have any transactions.",
"If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.": "If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.",
"Your update is now pending on LBRY. It will take a few minutes to appear for other users.": "Your update is now pending on LBRY. It will take a few minutes to appear for other users.",
"Your file is now pending on LBRY. It will take a few minutes to appear for other users.": "Your file is now pending on LBRY. It will take a few minutes to appear for other users.",
"Your livestream is now pending. You will be able to start shortly at the streaming dashboard.": "Your livestream is now pending. You will be able to start shortly at the streaming dashboard.",
"Your content will be live shortly.": "Your content will be live shortly.",
"Your video will appear on Odysee shortly.": "Your video will appear on Odysee shortly.",
"Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!": "Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!",
"No results for %query%": "No results for %query%",
"You haven't downloaded anything from LBRY yet": "You haven't downloaded anything from LBRY yet",
@@ -623,7 +648,7 @@
"Claim Channels": "Claim Channels",
"Say something about this...": "Say something about this...",
"Update email preferences": "Update email preferences",
"An account with lbry.tv allows you to earn rewards and backup your data.": "An account with lbry.tv allows you to earn rewards and backup your data.",
"An account allows you to earn rewards and backup your data.": "An account allows you to earn rewards and backup your data.",
"Backup your account and wallet data.": "Backup your account and wallet data.",
"Sign in": "Sign in",
"We just sent an email to %email% with a link for you to %verify_text%. Remember to check other email folders like spam or promotions.": "We just sent an email to %email% with a link for you to %verify_text%. Remember to check other email folders like spam or promotions.",
@@ -678,6 +703,11 @@
"Bid position must be a number.": "Bid position must be a number.",
"Copy": "Copy",
"Copy Link": "Copy Link",
"Link copied.": "Link copied.",
"Failed to copy link.": "Failed to copy link.",
"Copy RSS URL": "Copy RSS URL",
"RSS URL copied.": "RSS URL copied.",
"Failed to copy RSS URL.": "Failed to copy RSS URL.",
"Text copied": "Text copied",
"Rewards Disabled": "Rewards Disabled",
"Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%.": "Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%.",
@@ -709,10 +739,11 @@
"This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!",
"Publishing": "Publishing",
"Update published": "Update published",
"Livestream Created": "Livestream Created",
"Delete this file from my computer": "Delete this file from my computer",
"Are you sure you'd like to remove %title% from LBRY?": "Are you sure you'd like to remove %title% from LBRY?",
"reclaim %amount%": "reclaim %amount%",
"Abandon on blockchain (%lbc%)": "Abandon on blockchain (%lbc%)",
"Are you sure you'd like to remove %title%?": "Are you sure you'd like to remove %title%?",
"Remove from blockchain (%lbc%)": "Remove from blockchain (%lbc%)",
"Abandon on blockchain (reclaim %lbc%)": "Abandon on blockchain (reclaim %lbc%)",
"This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.": "This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.",
"Show this channel your appreciation by sending a donation.": "Show this channel your appreciation by sending a donation.",
"LBRY Link": "LBRY Link",
@@ -755,6 +786,7 @@
"Invite sent to %email_address%": "Invite sent to %email_address%",
"Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.": "Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.",
"Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.": "Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.",
"You earned %lbc% for helping LBRY grow. Friendship is magic.": "You earned %lbc% for helping LBRY grow. Friendship is magic.",
"This content requires LBRY Desktop to display.": "This content requires LBRY Desktop to display.",
"Get the App": "Get the App",
"Get The App": "Get The App",
@@ -788,7 +820,7 @@
"While we respect the desire for maximally private usage, please note that choosing this option hurts the ability for creators to understand how their content is performing.": "While we respect the desire for maximally private usage, please note that choosing this option hurts the ability for creators to understand how their content is performing.",
"Internal sharing is required while signed in.": "Internal sharing is required while signed in.",
"FINAL WARNING: This action is permanent and cannot be undone.": "FINAL WARNING: This action is permanent and cannot be undone.",
"This action is permanent and cannot be undone.": "This action is permanent and cannot be undone.",
"This action is permanent and cannot be undone": "This action is permanent and cannot be undone",
"Allow the app to access third party analytics platforms": "Allow the app to access third party analytics platforms",
"Share usage data with LBRY inc.": "Share usage data with LBRY inc.",
"Required": "Required",
@@ -796,6 +828,7 @@
"try again in a few seconds.": "try again in a few seconds.",
"Any": "Any",
"Video": "Video",
"Video/Audio": "Video/Audio",
"Document": "Document",
"Duration": "Duration",
"Long": "Long",
@@ -807,6 +840,7 @@
"gaming, crypto": "gaming, crypto",
"Autocomplete": "Autocomplete",
"Followed Tags": "Followed Tags",
"Manage Tags": "Manage Tags",
"%selectTagsLabel% (%number% left)": "%selectTagsLabel% (%number% left)",
"Matching": "Matching",
"Please check your deposit amount.": "Please check your deposit amount.",
@@ -822,10 +856,11 @@
"view all claims": "view all claims",
"Top claims at lbry://%name%": "Top claims at lbry://%name%",
"Last Updated": "Last Updated",
"Are you sure? Type %name% to confirm that you wish to delete the channel.": "Are you sure? Type %name% to confirm that you wish to delete the channel.",
"You're about to permanently delete a channel. Content published under this channel will be orphaned and their signing channel invalid. Content sync programs using this channel will fail.": "You're about to permanently delete a channel. Content published under this channel will be orphaned and their signing channel invalid. Content sync programs using this channel will fail.",
"Are you sure? Type %name% to confirm that you wish to remove the channel.": "Are you sure? Type %name% to confirm that you wish to remove the channel.",
"This will permanently remove your channel. Content published under this channel will be orphaned.": "This will permanently remove your channel. Content published under this channel will be orphaned.",
"Are you sure you'd like to remove \"%title%\"?": "Are you sure you'd like to remove \"%title%\"?",
"You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%.": "You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%.",
"LBRY works better if you find and follow a couple creators you like. You can also block channels you never want to see.": "LBRY works better if you find and follow a couple creators you like. You can also block channels you never want to see.",
"%SITE_NAME% works better if you find and follow a couple creators you like. You can also block channels you never want to see.": "%SITE_NAME% works better if you find and follow a couple creators you like. You can also block channels you never want to see.",
"Nice! You are currently following %followingCount% creator": "Nice! You are currently following %followingCount% creator",
"Nice! You are currently following %followingCount% creators": "Nice! You are currently following %followingCount% creators",
"Get Validated": "Get Validated",
@@ -855,7 +890,6 @@
"Back": "Back",
"Experimental Transcoding": "Experimental Transcoding",
"A Folder containing FFmpeg": "A Folder containing FFmpeg",
"Check again": "Check again",
"FFmpeg could not be found. Navigate to it or Install, Then %check_again% or quit and restart the app. %learn_more%": "FFmpeg could not be found. Navigate to it or Install, Then %check_again% or quit and restart the app. %learn_more%",
"FFmpeg is correctly configured. %learn_more%": "FFmpeg is correctly configured. %learn_more%",
"Finnish": "Finnish",
@@ -880,6 +914,7 @@
"Total Staked Amount": "Total Staked Amount",
"Set Inviter": "Set Inviter",
"Change Inviter": "Change Inviter",
"Reward claimed.": "Reward claimed.",
"You haven't uploaded anything yet. This is where you can find them when you do!": "You haven't uploaded anything yet. This is where you can find them when you do!",
"You haven't uploaded anything with this channel yet!": "You haven't uploaded anything with this channel yet!",
"You haven't uploaded anything": "You haven't uploaded anything",
@@ -912,6 +947,7 @@
"Embed this content": "Embed this content",
"More actions": "More actions",
"music": "music",
"Music": "Music",
"Transactions": "Transactions",
"Payment": "Payment",
"Stream": "Stream",
@@ -955,11 +991,14 @@
"Successfully abandoned your support.": "Successfully abandoned your support.",
"Transaction failed": "Transaction failed",
"Insufficient credits": "Insufficient credits",
"Error abandoning your claim/support": "Error abandoning your claim/support",
"Error unlocking your tip": "Error unlocking your tip",
"You deposited %lbc% as a support!": "You deposited %lbc% as a support!",
"You deposited %amount% LBRY Credits as a support!": "You deposited %amount% LBRY Credits as a support!",
"You sent %amount% LBRY Credits as a tip, Mahalo!": "You sent %amount% LBRY Credits as a tip, Mahalo!",
"You sent %amount% LBRY Credits": "You sent %amount% LBRY Credits",
"No stats found": "No stats found",
"Sorry about that. Try refreshing or something else.": "Sorry about that. Try refreshing or something else.",
"Sorry about that. Contact %SITE_HELP_EMAIL% if you continue to have issues.": "Sorry about that. Contact %SITE_HELP_EMAIL% if you continue to have issues.",
"You are not able to see this channel's stats. Make sure you are signed in with the correct email and have data sharing turned on.": "You are not able to see this channel's stats. Make sure you are signed in with the correct email and have data sharing turned on.",
"%follower_count% followers": "%follower_count% followers",
"Sign Up": "Sign Up",
@@ -1033,6 +1072,7 @@
"download the app": "download the app",
"lbry.tv collects usage information for itself only (%more_information%).": "lbry.tv collects usage information for itself only (%more_information%).",
"lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?": "lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?",
"more --[value for \"more_information\"]--": "more",
"%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.": "%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.",
"Please %sign_in_link% to comment.": "Please %sign_in_link% to comment.",
"Replying as %reply_channel%": "Replying as %reply_channel%",
@@ -1119,6 +1159,7 @@
"Update Your Password": "Update Your Password",
"Your Wallet is Empty": "Your Wallet is Empty",
"Buy Credits": "Buy Credits",
"Buy/Swap Credits": "Buy/Swap Credits",
"LBRY, Inc. partners with Moonpay to provide the option to purchase LBRY Credits. %learn_more%.": "LBRY, Inc. partners with Moonpay to provide the option to purchase LBRY Credits. %learn_more%.",
"Earn Rewards": "Earn Rewards",
"Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to re-enable them.": "Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to re-enable them.",
@@ -1145,6 +1186,7 @@
"Edit existing claim instead": "Edit existing claim instead",
"You already have a claim at %existing_uri%. Publishing will update (overwrite) your existing claim.": "You already have a claim at %existing_uri%. Publishing will update (overwrite) your existing claim.",
"Save": "Save",
"Saved": "Saved",
"Saving...": "Saving...",
"Downloading update": "Downloading update",
"complete": "complete",
@@ -1160,12 +1202,20 @@
"Changelog": "Changelog",
"Boost your content": "Boost your content",
"Boost This Video": "Boost This Video",
"Boost This %claimTypeText%": "Boost This %claimTypeText%",
"Send a $%displayAmount% Tip": "Send a $%displayAmount% Tip",
"Send a %displayAmount% Credit Tip": "Send a %displayAmount% Credit Tip",
"Boost": "Boost",
"Boosting": "Boosting",
"Tipping Credit": "Tipping Credit",
"Tipping Fiat (USD)": "Tipping Fiat (USD)",
"Send Revocable Support": "Send Revocable Support",
"Send a %amount% Tip": "Send a %amount% Tip",
"Channel to show support as": "Channel to show support as",
"Buy more LBRY Credits": "Buy more LBRY Credits",
"Support this content": "Support this content",
"Make this a tip": "Make this a tip",
"Buy or swap more LBRY Credits": "Buy or swap more LBRY Credits",
"Buy or Swap": "Buy or Swap",
"Support This %claimTypeText%": "Support This %claimTypeText%",
"Custom support amount": "Custom support amount",
"(%lbc_balance% Credits available)": "(%lbc_balance% Credits available)",
"Loading your channels...": "Loading your channels...",
@@ -1198,6 +1248,11 @@
"CableTube Escape Artists": "CableTube Escape Artists",
"Unlink YouTube Channel": "Unlink YouTube Channel",
"Log In With YouTube": "Log In With YouTube",
"You're free!": "You're free!",
"Welcome to Odysee": "Welcome to Odysee",
"You've escaped the land of spying, censorship, and exploitation.": "You've escaped the land of spying, censorship, and exploitation.",
"Welcome to the land of content freedom.": "Welcome to the land of content freedom.",
"You make the party extra special!": "You make the party extra special!",
"Cover": "Cover",
"A name is required for your url": "A name is required for your url",
"Create Channel": "Create Channel",
@@ -1214,14 +1269,20 @@
"%image_type% %recommended_ratio%": "%image_type% %recommended_ratio%",
"%label% • File to upload": "%label% • File to upload",
"Video file": "Video file",
"Select video file to upload": "Select video file to upload",
"Select video or audio file to upload": "Select video or audio file to upload",
"Select a file to upload": "Select a file to upload",
"Select file to upload": "Select file to upload",
"Url copied.": "Url copied.",
"Uploading...": "Uploading...",
"Creating...": "Creating...",
"Use a URL": "Use a URL",
"Edit Cover Image": "Edit Cover Image",
"Cover Image": "Cover Image",
"(6.25:1)": "(6.25:1)",
"(1:1)": "(1:1)",
"You Followed Your First Channel!": "You Followed Your First Channel!",
"You followed %CHANNEL_NAME%!": "You followed %CHANNEL_NAME%!",
"Unfollowed %CHANNEL_NAME%.": "Unfollowed %CHANNEL_NAME%.",
"Awesome! You just followed your first channel.": "Awesome! You just followed your first channel.",
"You will receive notifications related to new content.": "You will receive notifications related to new content.",
"Log in with %SITE_NAME% to receive notifications about new content.": "Log in with %SITE_NAME% to receive notifications about new content.",
@@ -1229,11 +1290,14 @@
"Anything": "Anything",
"Paid": "Paid",
"Start at": "Start at",
"Include List ID": "Include List ID",
"Links": "Links",
"LBRY URL": "LBRY URL",
"Download Link": "Download Link",
"Mature content is not supported.": "Mature content is not supported.",
"Mature content blocked.": "Mature content blocked.",
"Change this in your %content_settings%.": "Change this in your %content_settings%.",
"You can download the LBRY Desktop or Android app on %download_url% and enable mature content in Settings.": "You can download the LBRY Desktop or Android app on %download_url% and enable mature content in Settings.",
"content settings": "content settings",
"Autoplay next in list": "Autoplay next in list",
"Autoplay the next media file in the related list.": "Autoplay the next media file in the related list.",
@@ -1245,35 +1309,42 @@
"Check the status of various LBRY services.": "Check the status of various LBRY services.",
"Check Status": "Check Status",
"Upload your thumbnail to %domain%. Recommended size is 16:9.": "Upload your thumbnail to %domain%. Recommended size is 16:9.",
"(16:9)": "(16:9)",
"Are you sure you want to upload this thumbnail to %domain%": "Are you sure you want to upload this thumbnail to %domain%",
"View thumbnail": "View thumbnail",
"These changes will appear shortly.": "These changes will appear shortly.",
"Block": "Block",
"Block Channel": "Block Channel",
"Unblock Channel": "Unblock Channel",
"Blocking...": "Blocking...",
"Blocked": "Blocked",
"Channel \"%channel%\" blocked.": "Channel \"%channel%\" blocked.",
"Unblock": "Unblock",
"Unblock Channel": "Unblock Channel",
"Unblocking...": "Unblocking...",
"Channel blocked. You will not see them again.": "Channel blocked. You will not see them again.",
"Channel unblocked!": "Channel unblocked!",
"Mute Channel": "Mute Channel",
"Unmute Channel": "Unmute Channel",
"Muted": "Muted",
"Mute": "Mute",
"Unmute": "Unmute",
"Channel muted. You will not see them again.": "Channel muted. You will not see them again.",
"Manage notifications": "Manage notifications",
"Uploads": "Uploads",
"All uploads": "All uploads",
"Advanced settings": "Advanced settings",
"Browse": "Browse",
"Automatic transcoding": "Automatic transcoding",
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.",
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.",
"%site_name% Terms of Service": "%site_name% Terms of Service",
"Descriptive titles work best": "Descriptive titles work best",
"What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.": "What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.",
"Nothing uploaded to LBRY yet.": "Nothing uploaded to LBRY yet.",
"Copyright notice": "Copyright notice",
"Upload complete.": "Upload complete.",
"Upload Complete": "Upload Complete",
"Uploading": "Uploading",
"View My Uploads": "View My Uploads",
"View My Dashboard": "View My Dashboard",
"No recent uploads": "No recent uploads",
"Removing...": "Removing...",
"License description": "License description",
@@ -1315,6 +1386,7 @@
"Tech": "Tech",
"Lab": "Lab",
"Technology": "Technology",
"Movies": "Movies",
"News": "News",
"News & Politics": "News & Politics",
"Finance 2.0": "Finance 2.0",
@@ -1324,11 +1396,12 @@
"Sync YouTube Channel": "Sync YouTube Channel",
"Terms": "Terms",
"Privacy Policy": "Privacy Policy",
"Comment replies": "Comment replies",
"Daily watch availability": "Daily watch availability",
"Daily watch reminders": "Daily watch reminders",
"New content": "New content",
"Replies": "Replies",
"Others": "Others",
"HyperChat": "HyperChat",
"New Content": "New Content",
"No notifications": "No notifications",
"Try selecting another filter.": "Try selecting another filter.",
"You don't have any notifications yet, but they will be here when you do!": "You don't have any notifications yet, but they will be here when you do!",
"I like this": "I like this",
"I dislike this": "I dislike this",
@@ -1336,16 +1409,20 @@
"An account with %domain% allows you to earn rewards and backup your data.": "An account with %domain% allows you to earn rewards and backup your data.",
"Sync my YouTube channel": "Sync my YouTube channel",
"Log in to %SITE_NAME%": "Log in to %SITE_NAME%",
"Log in": "Log in",
"Not Yet": "Not Yet",
"Preparing...": "Preparing...",
"Confirm Upload": "Confirm Upload",
"Confirm Edit": "Confirm Edit",
"Create Livestream": "Create Livestream",
"File": "File",
"Transcode": "Transcode",
"Estimated transaction fee:": "Estimated transaction fee:",
"Est. transaction fee:": "Est. transaction fee:",
"Skip preview and confirmation": "Skip preview and confirmation",
"Upload settings": "Upload settings",
"Currently Uploading": "Currently Uploading",
"Leave the app running until upload is complete": "Leave the app running until upload is complete",
"Enable Sync": "Enable Sync",
"Disable Sync": "Disable Sync",
"Getting your profiles...": "Getting your profiles...",
@@ -1353,7 +1430,6 @@
"Disabling sync will switch to your local profile.": "Disabling sync will switch to your local profile.",
"To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.": "To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.",
"Something went wrong. Please %click_here% to learn about sync limitations.": "Something went wrong. Please %click_here% to learn about sync limitations.",
"Buy LBC": "Buy LBC",
"Continue...": "Continue...",
"Leave a comment": "Leave a comment",
"Be the first to comment!": "Be the first to comment!",
@@ -1369,13 +1445,24 @@
"You loved this": "You loved this",
"Creator loved this": "Creator loved this",
"A channel is required to throw fire and slime": "A channel is required to throw fire and slime",
"The requested comment is no longer available.": "The requested comment is no longer available.",
"Best": "Best",
"Controversial": "Controversial",
"Show Replies": "Show Replies",
"Hide replies": "Hide replies",
"Unable to create comment, please try again later.": "Unable to create comment, please try again later.",
"Unable to comment. This channel has blocked you.": "Unable to comment. This channel has blocked you.",
"Unable to comment. Your channel has been blocked by an admin.": "Unable to comment. Your channel has been blocked by an admin.",
"Unable to comment. The content owner has disabled comments.": "Unable to comment. The content owner has disabled comments.",
"Please do not spam.": "Please do not spam.",
"Slow mode is on. Please wait up to %1% seconds before commenting again.": "Slow mode is on. Please wait up to %1% seconds before commenting again.",
"The comment contains contents that are blocked by %1%.": "The comment contains contents that are blocked by %1%.",
"Your user name \"%1%\" is too close to the creator's user name \"%2%\" and may cause confusion. Please use another identity.": "Your user name \"%1%\" is too close to the creator's user name \"%2%\" and may cause confusion. Please use another identity.",
"Your channel is still being setup, try again in a few moments.": "Your channel is still being setup, try again in a few moments.",
"Unable to delete this comment, please try again later.": "Unable to delete this comment, please try again later.",
"Unable to edit this comment, please try again later.": "Unable to edit this comment, please try again later.",
"No active channel selected.": "No active channel selected.",
"Unable to verify your channel. Please try again.": "Unable to verify your channel. Please try again.",
"Channel cannot be anonymous, please select a channel and try again.": "Channel cannot be anonymous, please select a channel and try again.",
"Change to list layout": "Change to list layout",
"Change to tile layout": "Change to tile layout",
@@ -1396,18 +1483,22 @@
"gaming, comedy, educational": "gaming, comedy, educational",
"A channel is required to comment on %SITE_NAME%": "A channel is required to comment on %SITE_NAME%",
"A welcome bonus and thank you for your contribution to content freedom.": "A welcome bonus and thank you for your contribution to content freedom.",
"You earned %lbc% new user reward.": "You earned %lbc% new user reward.",
"Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.": "Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.",
"Claim your channel! Create an identity used to securely publish content.": "Claim your channel! Create an identity used to securely publish content.",
"You earned %lbc% for creating a channel.": "You earned %lbc% for creating a channel.",
"Launch your own channel by sharing a video.": "Launch your own channel by sharing a video.",
"Your First Credit:": "Your First Credit:",
"You earned %lbc% for making your first upload.": "You earned %lbc% for making your first upload.",
"Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.": "Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.",
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.",
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).",
"A small amount of Credits to get you started.": "A small amount of Credits to get you started.",
"Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.": "Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.",
"Some extra Credits for you and the person that brought you to us.": "Some extra Credits for you and the person that brought you to us.",
"Daily Watch Reward": "Daily Watch Reward",
"%SITE_NAME% view reward": "%SITE_NAME% view reward",
"You earned %lbc% for looking at neat stuff. ": "You earned %lbc% for looking at neat stuff. ",
"Earn a random reward of at least %lbc% for watching anything at all.": "Earn a random reward of at least %lbc% for watching anything at all.",
"You will receive an SMS text message confirming your phone number is valid.": "You will receive an SMS text message confirming your phone number is valid.",
"You have already claimed this reward within the last 24 hours.": "You have already claimed this reward within the last 24 hours.",
"Please watch some content to earn this reward.": "Please watch some content to earn this reward.",
"You will receive an SMS text message confirming your phone number is valid. May not be available in all regions.": "You will receive an SMS text message confirming your phone number is valid. May not be available in all regions.",
"Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.": "Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.",
"Your First Nickel": "Your First Nickel",
"Your First Credit": "Your First Credit",
@@ -1415,17 +1506,20 @@
"Channel Surfing": "Channel Surfing",
"First Upload": "First Upload",
"Welcome Back": "Welcome Back",
"You earned %lbc% for coming back.": "You earned %lbc% for coming back.",
"Email Verified": "Email Verified",
"You earned %lbc% for adding your email.": "You earned %lbc% for adding your email.",
"Inviter Bonus": "Inviter Bonus",
"Daily Watch Reward": "Daily Watch Reward",
"You earned %lbc% reward for you and your friend.": "You earned %lbc% reward for you and your friend.",
"Odyseenaut": "Odyseenaut",
"Watch 10 things, like 5 things, and leave a comment on odysee.com.": "Watch 10 things, like 5 things, and leave a comment on odysee.com.",
"You earned %lbc% for trying out Odysee.": "You earned %lbc% for trying out Odysee.",
"Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.": "Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.",
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.",
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).",
"You earned %lbc% for upgrading to the latest release of LBRY.": "You earned %lbc% for upgrading to the latest release of LBRY.",
"Create A Channel": "Create A Channel",
"At least 10 views are required to earn the reward, consume more!": "At least 10 views are required to earn the reward, consume more!",
"Blocked %channel%": "Blocked %channel%",
"Comment(s) blocked.": "Comment(s) blocked.",
"You earned %lbc% for streaming your first video.": "You earned %lbc% for streaming your first video.",
"You earned %lbc% for successfully completing The Journey L4: Perfect Harmony.": "You earned %lbc% for successfully completing The Journey L4: Perfect Harmony.",
"You earned %lbc% for successfully completing The Journey L3: Bliss.": "You earned %lbc% for successfully completing The Journey L3: Bliss.",
@@ -1445,12 +1539,30 @@
"You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.": "You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.",
"You earned %lbc% for successfully completing Coveted Creator L2: High Five.": "You earned %lbc% for successfully completing Coveted Creator L2: High Five.",
"You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.": "You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.",
"Favorite Five 🖐️": "Favorite Five 🖐️",
"When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.": "When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.",
"You earned %lbc% for reposting your favorite creators.": "You earned %lbc% for reposting your favorite creators.",
"🎁 Treats are available": "🎁 Treats are available",
"Claiming your daily reward is as easy as pressing this bell 🔔": "Claiming your daily reward is as easy as pressing this bell 🔔",
"Press ▶️ for 🎁": "Press ▶️ for 🎁",
"Your daily watch reward is ready": "Your daily watch reward is ready",
"Subscribe and s̶̶a̶̶v̶̶e̶ Earn": "Subscribe and s̶̶a̶̶v̶̶e̶ Earn",
"Follow your first channel for a reward 🎁": "Follow your first channel for a reward 🎁",
"Free LBC?": "Free LBC?",
"Free Credits?": "Free Credits?",
"You missed out on the daily view reward, sign up for our rewards program!": "You missed out on the daily view reward, sign up for our rewards program!",
"A Welcome 🎁": "A Welcome 🎁",
"Receive free Credits just for doing what you're already doing": "Receive free Credits just for doing what you're already doing",
"Watch more content to get to the next level.": "Watch more content to get to the next level.",
"Follow more channels to reach the next level.": "Follow more channels to reach the next level.",
"You need to improve the cool-aid (gain more followers) to get to the next level.": "You need to improve the cool-aid (gain more followers) to get to the next level.",
"A channel is required to repost on %SITE_NAME%": "A channel is required to repost on %SITE_NAME%",
"A channel is required to repost on lbry.tv": "A channel is required to repost on lbry.tv",
"No channels": "No channels",
"You haven't created a channel yet. All of your beautiful channels will be listed here!": "You haven't created a channel yet. All of your beautiful channels will be listed here!",
"Something didn't work. Please try again.": "Something didn't work. Please try again.",
"Sync your YouTube channel to %site_name%": "Sync your YouTube channel to %site_name%",
"You earned %lbc% for syncing your YouTube channel.": "You earned %lbc% for syncing your YouTube channel.",
"Get your YouTube videos in front of the %site_name% audience.": "Get your YouTube videos in front of the %site_name% audience.",
"Your %site_name% channel name": "Your %site_name% channel name",
"these terms": "these terms",
@@ -1493,6 +1605,7 @@
"Pin": "Pin",
"Unpin": "Unpin",
"LBRY leveled up": "LBRY leveled up",
"Channel language": "Channel language",
"Primary Language": "Primary Language",
"Your main content language": "Your main content language",
"None selected": "None selected",
@@ -1501,10 +1614,17 @@
"Search only in this language by default": "Search only in this language by default",
"This link leads to an external website.": "This link leads to an external website.",
"No Content Found": "No Content Found",
"No Lists Found": "No Lists Found",
"You have no lists! Create one from any playable content.": "You have no lists! Create one from any playable content.",
"Pick": "Pick",
"You have unpublished lists! %pick% one and publish it!": "You have unpublished lists! %pick% one and publish it!",
"No Reposts Found": "No Reposts Found",
"Publish Something": "Publish Something",
"Repost Something": "Repost Something",
"Watch on lbry.tv": "Watch on lbry.tv",
"Paid content cannot be embedded.": "Paid content cannot be embedded.",
"Please wait a bit, we are still getting your account ready.": "Please wait a bit, we are still getting your account ready.",
"this channel is connected to a different account. Contact hello@lbry.com for help.": "this channel is connected to a different account. Contact hello@lbry.com for help.",
"Most supported": "Most supported",
"Most Supported": "Most Supported",
"Search Results": "Search Results",
@@ -1544,6 +1664,7 @@
"Try refreshing to fix the issue. If that doesn't work, email %SITE_HELP_EMAIL% for support.": "Try refreshing to fix the issue. If that doesn't work, email %SITE_HELP_EMAIL% for support.",
"Content preview": "Content preview",
"Repost url": "Repost url",
"Repost URL": "Repost URL",
"Close sidebar - hide channels you are following": "Close sidebar - hide channels you are following",
"Expand sidebar - view channels you are following.": "Expand sidebar - view channels you are following.",
"You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.": "You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.",
@@ -1584,8 +1705,9 @@
"%balance% available.": "%balance% available.",
"Unlock all tips": "Unlock all tips",
"Unlock All": "Unlock All",
"Yeah, well, that's just, like, your opinion, man.": "Yeah, well, that's just, like, your opinion, man.",
"Working...": "Working...",
"Moon cheese is an acquired taste": "Moon cheese is an acquired taste",
"Nothing found here. Like big tech ethics.": "Nothing found here. Like big tech ethics.",
"Level %current_level%": "Level %current_level%",
"Creator tools": "Creator tools",
"Prevent this channel from interacting with you.": "Prevent this channel from interacting with you.",
@@ -1595,13 +1717,35 @@
"Transaction limit reached. Try reducing the Description length.": "Transaction limit reached. Try reducing the Description length.",
"You do not have any muted channels": "You do not have any muted channels",
"You do not have any blocked channels": "You do not have any blocked channels",
"Blocked channels will be invisible to you in the app. They will not be able to comment on your content, or reply to you comments left on other channels' content.": "Blocked channels will be invisible to you in the app. They will not be able to comment on your content, or reply to you comments left on other channels' content.",
"You do not have any globally-blocked channels": "You do not have any globally-blocked channels",
"You do not have any blocked channels as a moderator": "You do not have any blocked channels as a moderator",
"Blocked channels will be invisible to you in the app. They will not be able to comment on your content, nor reply to your comments left on other channels' content.": "Blocked channels will be invisible to you in the app. They will not be able to comment on your content, nor reply to your comments left on other channels' content.",
"Muted channels will be invisible to you in the app. They will not know they are muted and can still interact with you and your content.": "Muted channels will be invisible to you in the app. They will not know they are muted and can still interact with you and your content.",
"List of channels that you have blocked as a moderator, along with the list of delegators.": "List of channels that you have blocked as a moderator, along with the list of delegators.",
"This is the global block list.": "This is the global block list.",
"This channel is blocked": "This channel is blocked",
"This channel is muted": "This channel is muted",
"Are you sure you want to view this content? Viewing will not unblock @%channel%": "Are you sure you want to view this content? Viewing will not unblock @%channel%",
"Are you sure you want to view this content? Viewing will not unmute @%channel%": "Are you sure you want to view this content? Viewing will not unmute @%channel%",
"View Content": "View Content",
"Global": "Global",
"Moderator": "Moderator",
"Global Unblock Channel": "Global Unblock Channel",
"Global Block Channel": "Global Block Channel",
"Moderator tools": "Moderator tools",
"Global Block": "Global Block",
"Block this channel as global admin": "Block this channel as global admin",
"Moderator Block": "Moderator Block",
"Block this channel on behalf of %creator%": "Block this channel on behalf of %creator%",
"creator": "creator",
"Create a channel to change this setting.": "Create a channel to change this setting.",
"Invalid channel URL \"%url%\"": "Invalid channel URL \"%url%\"",
"Delegation": "Delegation",
"Add moderator": "Add moderator",
"Enter a @username or URL": "Enter a @username or URL",
"examples: @channel, @channel#3, https://odysee.com/@Odysee:8, lbry://@Odysee#8": "examples: @channel, @channel#3, https://odysee.com/@Odysee:8, lbry://@Odysee#8",
"Moderators": "Moderators",
"Add as moderator": "Add as moderator",
"Mute (m)": "Mute (m)",
"Playback Rate (<, >)": "Playback Rate (<, >)",
"Fullscreen (f)": "Fullscreen (f)",
@@ -1611,6 +1755,339 @@
"Exit Fullscreen (f)": "Exit Fullscreen (f)",
"Toggle Theater mode (t)": "Toggle Theater mode (t)",
"Quality": "Quality",
"--end--": "--end--",
"Announcements, updates, and rewards specific to users of LBRY Android.": "Announcements, updates, and rewards specific to users of LBRY Android.",
"LBRY has special programs and opportunities for people in school.": "LBRY has special programs and opportunities for people in school.",
"Creator specific news, automated reports, and other updates.": "Creator specific news, automated reports, and other updates.",
"Get notified when other channels repost your content.": "Get notified when other channels repost your content.",
"Technical updates and other news for software engineers and technical users.": "Technical updates and other news for software engineers and technical users.",
"Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!": "Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!",
"News and updates from LBRY": "News and updates from LBRY",
"Announcements, updates, and rewards specific to users of LBRY Desktop": "Announcements, updates, and rewards specific to users of LBRY Desktop",
"Communications about lbry.org, the community-owned and operated LBRY group": "Communications about lbry.org, the community-owned and operated LBRY group",
"Announcements, updates, and rewards specific to users of lbry.tv": "Announcements, updates, and rewards specific to users of lbry.tv",
"Receive emails about the latest rewards that are available to LBRY users.": "Receive emails about the latest rewards that are available to LBRY users.",
"Stay up to date on the latest content from your favorite creators.": "Stay up to date on the latest content from your favorite creators.",
"Receive tutorial emails related to LBRY ": "Receive tutorial emails related to LBRY ",
"Create A LiveStream": "Create A LiveStream",
"%channel% has disabled chat for this stream. Enjoy the stream!": "%channel% has disabled chat for this stream. Enjoy the stream!",
"This channel has disabled chat for this stream. Enjoy the stream!": "This channel has disabled chat for this stream. Enjoy the stream!",
"%channel% isn't live right now, but the chat is! Check back later to watch the stream.": "%channel% isn't live right now, but the chat is! Check back later to watch the stream.",
"This channel isn't live right now, but the chat is! Check back later to watch the stream.": "This channel isn't live right now, but the chat is! Check back later to watch the stream.",
"Right now": "Right now",
"%viewer_count% currently watching": "%viewer_count% currently watching",
"Slowmode is on. You can comment again in %time% seconds.": "Slowmode is on. You can comment again in %time% seconds.",
"Live stream in progress": "Live stream in progress",
"Live discussion": "Live discussion",
"Livestream": "Livestream",
"Your stream key": "Your stream key",
"Stream server": "Stream server",
"Stream key": "Stream key",
"Your livestream uploads": "Your livestream uploads",
"Your pending livestream uploads": "Your pending livestream uploads",
"No livestream publishes found": "No livestream publishes found",
"Nothing here yet. %check_again%": "Nothing here yet. %check_again%",
"Check again": "Check again",
"Check again...": "Check again...",
"Only visible to you": "Only visible to you",
"People who view this link will be redirected to your livestream. Make sure to use this for sharing so your title and thumbnail are displayed properly.": "People who view this link will be redirected to your livestream. Make sure to use this for sharing so your title and thumbnail are displayed properly.",
"View livestream": "View livestream",
"You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.": "You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.",
"Create A Livestream": "Create A Livestream",
"Create a Livestream by first submitting your livestream details and waiting for approval confirmation. This can be done well in advance and will take a few minutes.": "Create a Livestream by first submitting your livestream details and waiting for approval confirmation. This can be done well in advance and will take a few minutes.",
"The livestream will not be visible on your channel page until you are live, but you can share the URL in advance.": "The livestream will not be visible on your channel page until you are live, but you can share the URL in advance.",
"Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.": "Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.",
"To ensure the best streaming experience with OBS, open settings -> output": "To ensure the best streaming experience with OBS, open settings -> output",
"Select advanced mode from the dropdown at the top.": "Select advanced mode from the dropdown at the top.",
"Ensure the following settings are selected under the streaming tab:": "Ensure the following settings are selected under the streaming tab:",
"Bitrate: 1000 to 2500 kbps": "Bitrate: 1000 to 2500 kbps",
"Keyframes: 1": "Keyframes: 1",
"Profile: High": "Profile: High",
"Tune: Zerolatency": "Tune: Zerolatency",
"If using other streaming software, make sure the bitrate is below 4500 kbps or the stream will not work.": "If using other streaming software, make sure the bitrate is below 4500 kbps or the stream will not work.",
"After your stream:\nClick the Update button on the content page. This will allow you to select a replay or upload your own edited MP4. Replays are limited to 4 hours and may take a few minutes to show (use the Check For Replays button).": "After your stream:\nClick the Update button on the content page. This will allow you to select a replay or upload your own edited MP4. Replays are limited to 4 hours and may take a few minutes to show (use the Check For Replays button).",
"Click Save, then confirm, and you are done!": "Click Save, then confirm, and you are done!",
"Note: If you don't plan on publishing your replay, you'll want to delete your livestream and then start with a fresh one next time.": "Note: If you don't plan on publishing your replay, you'll want to delete your livestream and then start with a fresh one next time.",
"How does this work?": "How does this work?",
"Introducing Lists": "Introducing Lists",
"You have no lists yet. Better start hoarding!": "You have no lists yet. Better start hoarding!",
"Update your livestream": "Update your livestream",
"Prepare an upcoming livestream": "Prepare an upcoming livestream",
"Edit your post": "Edit your post",
"Update your content": "Update your content",
"Go Live on Odysee": "Go Live on Odysee",
"You're invited to try out our new livestreaming service while in beta!": "You're invited to try out our new livestreaming service while in beta!",
"lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead": "lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead",
"lbry.tv is being retired in favor of %odysee%": "lbry.tv is being retired in favor of %odysee%",
"You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.": "You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.",
"Swap": "Swap",
"Swap Crypto": "Swap Crypto",
"Enter desired %lbc%": "Enter desired %lbc%",
"Estimated BTC price": "Estimated BTC price",
"Start Swap": "Start Swap",
"To": "To",
"Receiving": "Receiving",
"Send crypto to the address provided and you will be sent an equivalent amount of Credits. You can pay with BCH, LTC, ETH, USDC or DAI after starting the swap.": "Send crypto to the address provided and you will be sent an equivalent amount of Credits. You can pay with BCH, LTC, ETH, USDC or DAI after starting the swap.",
"Swap Crypto for %lbc%": "Swap Crypto for %lbc%",
"Processing...": "Processing...",
"View Past Swaps": "View Past Swaps",
"Remove swap": "Remove swap",
"Waiting": "Waiting",
"Waiting to receive your crypto.": "Waiting to receive your crypto.",
"Confirming transaction.": "Confirming transaction.",
"Sending Credits": "Sending Credits",
"Crypto received. Sending your Credits.": "Crypto received. Sending your Credits.",
"Completed": "Completed",
"Credits sent. You should see it in your wallet.": "Credits sent. You should see it in your wallet.",
"Expired": "Expired",
"Swap expired.": "Swap expired.",
"Failed": "Failed",
"An error occurred on the previous swap.": "An error occurred on the previous swap.",
"Alternative coins": "Alternative coins",
"Failed to initiate swap.": "Failed to initiate swap.",
"Failed to query swap status.": "Failed to query swap status.",
"The system is currently down. Come back later.": "The system is currently down. Come back later.",
"Unable to obtain exchange rate. Try again later.": "Unable to obtain exchange rate. Try again later.",
"The amount needs to be higher": "The amount needs to be higher",
"The amount is too high": "The amount is too high",
"Confirm Swap Removal": "Confirm Swap Removal",
"Remove Swap": "Remove Swap",
"Remove %address%?": "Remove %address%?",
"This process cannot be reversed.": "This process cannot be reversed.",
"View transaction": "View transaction",
"Use the copy button to ensure the EXACT amount is sent!": "Use the copy button to ensure the EXACT amount is sent!",
"Amount copied.": "Amount copied.",
"Copy transaction ID": "Copy transaction ID",
"Transaction ID copied.": "Transaction ID copied.",
"This page can be closed while the transactions are in progress.\nYou can view the status later from:\n • Wallet » Swap » View Past Swaps": "This page can be closed while the transactions are in progress.\nYou can view the status later from:\n • Wallet » Swap » View Past Swaps",
"Credits sent": "Credits sent",
"Unresolved": "Unresolved",
"Received amount did not match order code %chargeCode%. Contact hello@lbry.com to resolve the payment.": "Received amount did not match order code %chargeCode%. Contact hello@lbry.com to resolve the payment.",
"Users are currently limited to 4 completed swaps per month or 5 pending swaps.": "Users are currently limited to 4 completed swaps per month or 5 pending swaps.",
"publish": "publish",
"Sexual content": "Sexual content",
"Violent or repulsive content": "Violent or repulsive content",
"Hateful or abusive content": "Hateful or abusive content",
"Harmful or dangerous acts": "Harmful or dangerous acts",
"Child abuse": "Child abuse",
"Promotes terrorism": "Promotes terrorism",
"Spam or misleading": "Spam or misleading",
"Infringes my rights": "Infringes my rights",
"Next": "Next",
"Graphic sexual activity": "Graphic sexual activity",
"Nudity": "Nudity",
"Suggestive, but without nudity": "Suggestive, but without nudity",
"Content involving minors": "Content involving minors",
"Sexual Abusive title or description": "Sexual Abusive title or description",
"Other sexual content": "Other sexual content",
"Timestamp": "Timestamp",
"Provide additional details": "Provide additional details",
"e.g. John Doe": "e.g. John Doe",
"e.g. john@example.com": "e.g. john@example.com",
"e.g. satoshi@example.com": "e.g. satoshi@example.com",
"Your channel": "Your channel",
"Set to \"Anonymous\" if you do not want to associate your channel in this report.": "Set to \"Anonymous\" if you do not want to associate your channel in this report.",
"Send report?": "Send report?",
"Send Report": "Send Report",
"Contact details": "Contact details",
"Report submitted": "Report submitted",
"We will review and respond shortly.": "We will review and respond shortly.",
"Adults fighting": "Adults fighting",
"Physical attack": "Physical attack",
"Youth violence": "Youth violence",
"Animal abuse": "Animal abuse",
"Promotes hatred or violence": "Promotes hatred or violence",
"Bullying": "Bullying",
"Hateful Abusive title or description": "Hateful Abusive title or description",
"Pharmaceutical or drug abuse": "Pharmaceutical or drug abuse",
"Abuse of fire or explosives": "Abuse of fire or explosives",
"Suicide or self injury": "Suicide or self injury",
"Other dangerous acts": "Other dangerous acts",
"Mass advertising": "Mass advertising",
"Pharmaceutical drugs for sale": "Pharmaceutical drugs for sale",
"Misleading text": "Misleading text",
"Misleading thumbnail": "Misleading thumbnail",
"Scams or fraud": "Scams or fraud",
"Copyright issue": "Copyright issue",
"Other legal issue": "Other legal issue",
"Affected party": "Affected party",
"Myself": "Myself",
"My company, organization, or client": "My company, organization, or client",
"Copyright owner name": "Copyright owner name",
"Relationship to copyrighted content": "Relationship to copyrighted content",
"(between 10 to 500 characters)": "(between 10 to 500 characters)",
"Remove now": "Remove now",
"Additional email (optional)": "Additional email (optional)",
"Phone number": "Phone number",
"Address": "Address",
"City": "City",
"State/province": "State/province",
"Zip code": "Zip code",
"Signature": "Signature",
"Your name": "Your name",
"Acting on behalf of": "Acting on behalf of",
"Self": "Self",
"Client": "Client",
"Title of specific law": "Title of specific law",
"Specific law": "Specific law",
"Law URL": "Law URL",
"Clarification": "Clarification",
"Client name": "Client name",
"Creator settings": "Creator settings",
"Muted words": "Muted words",
"Add words": "Add words",
"Suggestions": "Suggestions",
"Add words to block": "Add words to block",
"Enable comments for channel.": "Enable comments for channel.",
"Minimum time gap in seconds between comments (affects livestream chat as well).": "Minimum time gap in seconds between comments (affects livestream chat as well).",
"Minimum %lbc% tip amount for comments": "Minimum %lbc% tip amount for comments",
"Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.": "Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.",
"Minimum %lbc% tip amount for hyperchats": "Minimum %lbc% tip amount for hyperchats",
"Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.": "Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.",
"Settings unavailable for this channel": "Settings unavailable for this channel",
"This channel isn't staking enough LBRY Credits to enable Creator Settings.": "This channel isn't staking enough LBRY Credits to enable Creator Settings.",
"Not a channel (prefix with \"@\", or enter the channel URL)": "Not a channel (prefix with \"@\", or enter the channel URL)",
"We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.": "We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.",
"Help LBRY Save Crypto": "Help LBRY Save Crypto",
"The US government is attempting to destroy the cryptocurrency industry. Can you help?": "The US government is attempting to destroy the cryptocurrency industry. Can you help?",
"Learn more and sign petition": "Learn more and sign petition",
"View claim details": "View claim details",
"Publishing...": "Publishing...",
"Enter a name, @username or URL": "Enter a name, @username or URL",
"Recipient search": "Recipient search",
"Fetch transaction data for export": "Fetch transaction data for export",
"Fetching data": "Fetching data",
"Download fetched file": "Download fetched file",
"No data to export": "No data to export",
"Failed to process fetched data.": "Failed to process fetched data.",
"More from %claim_name%": "More from %claim_name%",
"Update your video/audio": "Update your video/audio",
"Upload that unlabeled video or cassette you found behind the TV in 1991": "Upload that unlabeled video or cassette you found behind the TV in 1991",
"Select Replay": "Select Replay",
"Craft an epic post clearly explaining... whatever.": "Craft an epic post clearly explaining... whatever.",
"%viewer_count% currently %viewer_state%": "%viewer_count% currently %viewer_state%",
"watching": "watching",
"waiting": "waiting",
"Choose Replay": "Choose Replay",
"Choose a replay file, or select None": "Choose a replay file, or select None",
"No replays found.": "No replays found.",
"Replay video available": "Replay video available",
"Check for Replays": "Check for Replays",
"You can upload your own recording or select a replay when your stream is over": "You can upload your own recording or select a replay when your stream is over",
"This channel isn't staking enough LBRY Credits for inline image previews.": "This channel isn't staking enough LBRY Credits for inline image previews.",
"Latest": "Latest",
"Channel Not Found": "Channel Not Found",
"Probably because you didn't make it.": "Probably because you didn't make it.",
"Release date": "Release date",
"Set custom release date": "Set custom release date",
"Now": "Now",
"Set to current date and time": "Set to current date and time",
"Remove custom release date": "Remove custom release date",
"%SITE_NAME% login": "%SITE_NAME% login",
"Lists": "Lists",
"Watch Later": "Watch Later",
"Favorites": "Favorites",
"New List": "New List",
"New List Title": "New List Title",
"Add to Lists": "Add to Lists",
"Playlists": "Playlists",
"Edit List": "Edit List",
"Delete List": "Delete List",
"Private": "Private",
"View List": "View List",
"Publish List": "Publish List",
"Info": "Info",
"Publishes": "Publishes",
"Add To...": "Add To...",
"Unpublished Edits": "Unpublished Edits",
"(Empty) --[indicates empty playlist]--": "(Empty)",
"Report channel": "Report channel",
"List": "List",
"Items": "Items",
"Credits": "Credits",
"Cannot publish empty list": "Cannot publish empty list",
"MyAwesomeList": "MyAwesomeList",
"My Awesome List": "My Awesome List",
"This list has no items.": "This list has no items.",
"Select File": "Select File",
"File Selected": "File Selected",
"Url": "Url",
"URL Selected": "URL Selected",
"Keep": "Keep",
"Add this claim to a list": "Add this claim to a list",
"List is Empty": "List is Empty",
"Confirm List Unpublish": "Confirm List Unpublish",
"This will permanently delete the list.": "This will permanently delete the list.",
"Everyone starts with 2 private lists - Watch Later and Favorites.": "Everyone starts with 2 private lists - Watch Later and Favorites.",
"Add content to existing lists or new lists from content pages or content previews.": "Add content to existing lists or new lists from content pages or content previews.",
"By default, lists are private. You can edit them and later publish them from the Lists page or the Publish context menu on this page. Similar to uploads, small blockchain fees apply.": "By default, lists are private. You can edit them and later publish them from the Lists page or the Publish context menu on this page. Similar to uploads, small blockchain fees apply.",
"Chat": "Chat",
"Tipped": "Tipped",
"Fromage": "Fromage",
"In Favorites": "In Favorites",
"In Watch Later": "In Watch Later",
"In %lastCollectionName%": "In %lastCollectionName%",
"Remove from Watch Later": "Remove from Watch Later",
"Add to Watch Later": "Add to Watch Later",
"Added": "Added",
"Item removed from %name%": "Item removed from %name%",
"Item added to %name%": "Item added to %name%",
"Item added to Watch Later": "Item added to Watch Later",
"Item removed from Watch Later": "Item removed from Watch Later",
"Item added to Favorites": "Item added to Favorites",
"Item removed from Favorites": "Item removed from Favorites",
"Your publish is being confirmed and will be live soon": "Your publish is being confirmed and will be live soon",
"Clear Edits": "Clear Edits",
"Something not quite right..": "Something not quite right..",
"Comments server": "Comments server",
"Default comments server (%name%)": "Default comments server (%name%)",
"Custom comments server": "Custom comments server",
"Failed to fetch comments.": "Failed to fetch comments.",
"Failed to fetch comments. Verify custom server settings.": "Failed to fetch comments. Verify custom server settings.",
"Commenting server is not set.": "Commenting server is not set.",
"Comments are not currently enabled.": "Comments are not currently enabled.",
"See All": "See All",
"Supporting content requires %lbc%": "Supporting content requires %lbc%",
"With %lbc%, you can send tips to your favorite creators, or help boost their content for more people to see.": "With %lbc%, you can send tips to your favorite creators, or help boost their content for more people to see.",
"Show this channel your appreciation by sending a donation in USD.": "Show this channel your appreciation by sending a donation in USD.",
"This refundable boost will improve the discoverability of this %claimTypeText% while active.": "This refundable boost will improve the discoverability of this %claimTypeText% while active.",
"Show this channel your appreciation by sending a donation of Credits.": "Show this channel your appreciation by sending a donation of Credits.",
"Add card to tip creators in USD": "Add card to tip creators in USD",
"Connect a bank account": "Connect a bank account",
"Getting your bank account connection status...": "Getting your bank account connection status...",
"Connect your bank account to Odysee to receive donations directly from users": "Connect your bank account to Odysee to receive donations directly from users",
"Connect your bank account": "Connect your bank account",
"Manage Card": "Manage Card",
"Congratulations! Your account has been connected with Odysee.": "Congratulations! Your account has been connected with Odysee.",
"Your account balance is %balance% USD. Functionality to view your transactions and withdraw your balance will be landing shortly.": "Your account balance is %balance% USD. Functionality to view your transactions and withdraw your balance will be landing shortly.",
"Your account balance is $0 USD. When you receive a tip you will see it here.": "Your account balance is $0 USD. When you receive a tip you will see it here.",
"Congratulations, you have already begun receiving tips on Odysee!": "Congratulations, you have already begun receiving tips on Odysee!",
"Your pending account balance is %balance% USD. Functionality to view and receive your transactions will land soon.": "Your pending account balance is %balance% USD. Functionality to view and receive your transactions will land soon.",
"Connect your bank account to be able to cash your pending balance out to your account.": "Connect your bank account to be able to cash your pending balance out to your account.",
"You sent $%amount% as a tip to %tipChannelName%, I'm sure they appreciate it!": "You sent $%amount% as a tip to %tipChannelName%, I'm sure they appreciate it!",
"Tip Creators": "Tip Creators",
"Only select creators can receive tips at this time": "Only select creators can receive tips at this time",
"The payment will be made from your saved card": "The payment will be made from your saved card",
"Commenting...": "Commenting...",
"Show %count% replies": "Show %count% replies",
"Show reply": "Show reply",
"added to": "added to",
"removed from": "removed from",
"Skip Navigation": "Skip Navigation",
"Reset": "Reset",
"Reset to original (previous) publish date": "Reset to original (previous) publish date",
"Search for something...": "Search for something...",
"Confirm Comment Deletion": "Confirm Comment Deletion",
"Remove Comment": "Remove Comment",
"Are you sure you want to remove this comment?": "Are you sure you want to remove this comment?",
"This comment has a tip associated with it which cannot be reverted.": "This comment has a tip associated with it which cannot be reverted.",
"Recent Comments": "Recent Comments",
"%title% by %channelTitle%": "%title% by %channelTitle%",
"%title% by %channelTitle% %ariaDate%": "%title% by %channelTitle% %ariaDate%",
"%title% by %channelTitle% %ariaDate%, %mediaDuration%": "%title% by %channelTitle% %ariaDate%, %mediaDuration%",
"Collapse Thread": "Collapse Thread",
"Collapse": "Collapse",
"Expand Comments": "Expand Comments",
"Expand": "Expand",
"Load More": "Load More",
"--end--": "--end--"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+8 -7
View File
@@ -3,14 +3,15 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/public/favicon.png" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<link rel="preload" href="/public/font/v1/300.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/300i.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/400.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/400i.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/700.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/700i.woff" as="font" type="font/woff" />
<link rel="preload" href="/public/font/v1/300.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/300i.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/400.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/400i.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/700.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/700i.woff" as="font" type="font/woff" crossorigin />
<style>
@font-face {
+191 -61
View File
@@ -9,14 +9,17 @@ import Native from 'native';
import ElectronCookies from '@exponent/electron-cookies';
import { generateInitialUrl } from 'util/url';
// @endif
import { MATOMO_ID, MATOMO_URL, LBRY_WEB_BUFFER_API } from 'config';
import { MATOMO_ID, MATOMO_URL } from 'config';
const isProduction = process.env.NODE_ENV === 'production';
const devInternalApis = process.env.LBRY_API_URL;
const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev');
export const SHARE_INTERNAL = 'shareInternal';
const SHARE_THIRD_PARTY = 'shareThirdParty';
const WATCHMAN_BACKEND_ENDPOINT = 'https://watchman.na-backend.odysee.com/reports/playback';
const SEND_DATA_TO_WATCHMAN_INTERVAL = 10; // in seconds
// @if TARGET='app'
if (isProduction) {
ElectronCookies.enable({
@@ -26,10 +29,10 @@ if (isProduction) {
// @endif
type Analytics = {
error: string => Promise<any>,
error: (string) => Promise<any>,
sentryError: ({} | string, {}) => Promise<any>,
pageView: (string, ?string) => void,
setUser: Object => void,
setUser: (Object) => void,
toggleInternal: (boolean, ?boolean) => void,
apiLogView: (string, string, string, ?number, ?() => void) => Promise<any>,
apiLogPublish: (ChannelClaim | StreamClaim) => void,
@@ -37,8 +40,8 @@ type Analytics = {
tagFollowEvent: (string, boolean, ?string) => void,
playerLoadedEvent: (?boolean) => void,
playerStartedEvent: (?boolean) => void,
videoFetchDuration: (string, number) => void,
videoStartEvent: (string, number) => void,
videoStartEvent: (string, number, string, number, string, any) => void,
videoIsPlaying: (boolean, any) => void,
videoBufferEvent: (
StreamClaim,
{
@@ -50,14 +53,17 @@ type Analytics = {
playerPoweredBy: string,
readyState: number,
}
) => void,
) => Promise<any>,
adsFetchedEvent: () => void,
adsReceivedEvent: (any) => void,
adsErrorEvent: (any) => void,
emailProvidedEvent: () => void,
emailVerifiedEvent: () => void,
rewardEligibleEvent: () => void,
startupEvent: () => void,
purchaseEvent: number => void,
readyEvent: number => void,
openUrlEvent: string => void,
purchaseEvent: (number) => void,
readyEvent: (number) => void,
openUrlEvent: (string) => void,
};
type LogPublishParams = {
@@ -74,9 +80,169 @@ if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEna
// if (window.localStorage.getItem(SHARE_THIRD_PARTY) === 'true') thirdPartyAnalyticsEnabled = true;
// @endif
/**
* Determine the mobile device type viewing the data
* This function returns one of 'and' (Android), 'ios', or 'web'.
*
* @returns {String}
*/
function getDeviceType() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/android/i.test(userAgent)) {
return 'and';
}
// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return 'ios';
}
// default as web, this can be optimized
return 'web';
}
// variables initialized for watchman
let amountOfBufferEvents = 0;
let amountOfBufferTimeInMS = 0;
let videoType, userId, claimUrl, playerPoweredBy, videoPlayer;
let lastSentTime;
// calculate data for backend, send them, and reset buffer data for next interval
async function sendAndResetWatchmanData() {
if (!userId) {
return 'Can only be used with a user id';
}
let timeSinceLastIntervalSend = new Date() - lastSentTime;
lastSentTime = new Date();
let protocol;
if (videoType === 'application/x-mpegURL') {
protocol = 'hls';
} else {
protocol = 'stb';
}
// current position in video in MS
const positionInVideo = Math.round(videoPlayer.currentTime()) * 1000;
// get the duration marking the time in the video for relative position calculation
const totalDurationInSeconds = Math.round(videoPlayer.duration());
// build object for watchman backend
const objectToSend = {
rebuf_count: amountOfBufferEvents,
rebuf_duration: amountOfBufferTimeInMS,
url: claimUrl.replace('lbry://', ''),
device: getDeviceType(),
duration: timeSinceLastIntervalSend,
protocol,
player: playerPoweredBy,
user_id: userId.toString(),
position: Math.round(positionInVideo),
rel_position: Math.round((positionInVideo / (totalDurationInSeconds * 1000)) * 100),
};
// post to watchman
await sendWatchmanData(objectToSend);
// reset buffer data
amountOfBufferEvents = 0;
amountOfBufferTimeInMS = 0;
}
let watchmanInterval;
// clear watchman interval and mark it as null (when video paused)
function stopWatchmanInterval() {
clearInterval(watchmanInterval);
watchmanInterval = null;
}
// creates the setInterval that will run send to watchman on recurring basis
function startWatchmanIntervalIfNotRunning() {
if (!watchmanInterval) {
// instantiate the first time to calculate duration from
lastSentTime = new Date();
// only set an interval if analytics are enabled and is prod
if (internalAnalyticsEnabled && isProduction) {
watchmanInterval = setInterval(sendAndResetWatchmanData, 1000 * SEND_DATA_TO_WATCHMAN_INTERVAL);
}
}
}
// post data to the backend
async function sendWatchmanData(body) {
try {
const response = await fetch(WATCHMAN_BACKEND_ENDPOINT, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
return response;
} catch (err) {
console.log('ERROR FROM WATCHMAN BACKEND');
console.log(err);
}
}
const analytics: Analytics = {
error: message => {
return new Promise(resolve => {
// receive buffer events from tracking plugin and jklj
videoBufferEvent: async (claim, data) => {
amountOfBufferEvents = amountOfBufferEvents + 1;
amountOfBufferTimeInMS = amountOfBufferTimeInMS + data.bufferDuration;
},
onDispose: () => {
stopWatchmanInterval();
},
/**
* Is told whether video is being started or paused, and adjusts interval accordingly
* @param {boolean} isPlaying - Whether video was started or paused
* @param {object} passedPlayer - VideoJS Player object
*/
videoIsPlaying: (isPlaying, passedPlayer) => {
let playerIsSeeking = false;
// have to use this because videojs pauses/unpauses during seek
// sometimes the seeking function isn't populated yet so check for it as well
if (passedPlayer && passedPlayer.seeking) {
playerIsSeeking = passedPlayer.seeking();
}
// if being paused, and not seeking, send existing data and stop interval
if (!isPlaying && !playerIsSeeking) {
sendAndResetWatchmanData();
stopWatchmanInterval();
// if being told to pause, and seeking, send and restart interval
} else if (!isPlaying && playerIsSeeking) {
sendAndResetWatchmanData();
stopWatchmanInterval();
startWatchmanIntervalIfNotRunning();
// is being told to play, and seeking, don't do anything,
// assume it's been started already from pause
} else if (isPlaying && playerIsSeeking) {
// start but not a seek, assuming a start from paused content
} else if (isPlaying && !playerIsSeeking) {
startWatchmanIntervalIfNotRunning();
}
},
videoStartEvent: (claimId, duration, poweredBy, passedUserId, canonicalUrl, passedPlayer) => {
// populate values for watchman when video starts
userId = passedUserId;
claimUrl = canonicalUrl;
playerPoweredBy = poweredBy;
videoType = passedPlayer.currentSource().type;
videoPlayer = passedPlayer;
sendPromMetric('time_to_start', duration);
sendMatomoEvent('Media', 'TimeToStart', claimId, duration);
},
error: (message) => {
return new Promise((resolve) => {
if (internalAnalyticsEnabled && isProduction) {
return Lbryio.call('event', 'desktop_error', { error_message: message }).then(() => {
resolve(true);
@@ -87,9 +253,9 @@ const analytics: Analytics = {
});
},
sentryError: (error, errorInfo) => {
return new Promise(resolve => {
return new Promise((resolve) => {
if (internalAnalyticsEnabled && isProduction) {
Sentry.withScope(scope => {
Sentry.withScope((scope) => {
scope.setExtras(errorInfo);
const eventId = Sentry.captureException(error);
resolve(eventId);
@@ -114,7 +280,7 @@ const analytics: Analytics = {
MatomoInstance.trackPageView(params);
}
},
setUser: userId => {
setUser: (userId) => {
if (internalAnalyticsEnabled && userId) {
window._paq.push(['setUserId', String(userId)]);
// @if TARGET='app'
@@ -188,60 +354,24 @@ const analytics: Analytics = {
}
},
apiSyncTags: params => {
apiSyncTags: (params) => {
if (internalAnalyticsEnabled && isProduction) {
Lbryio.call('content_tags', 'sync', params);
}
},
apiSearchFeedback: (query, vote) => {
if (isProduction) {
// We don't need to worry about analytics enabled here because users manually click on the button to provide feedback
Lbryio.call('feedback', 'search', { query, vote });
}
adsFetchedEvent: () => {
sendMatomoEvent('Media', 'AdsFetched');
},
videoFetchDuration: (source, duration) => {
sendPromMetric('time_to_fetch', duration);
sendMatomoEvent('Media', 'TimeToFetch', source, duration);
adsReceivedEvent: (response) => {
sendMatomoEvent('Media', 'AdsReceived', JSON.stringify(response));
},
videoStartEvent: (claimId, duration) => {
sendPromMetric('time_to_start', duration);
sendMatomoEvent('Media', 'TimeToStart', claimId, duration);
adsErrorEvent: (response) => {
sendMatomoEvent('Media', 'AdsError', JSON.stringify(response));
},
videoBufferEvent: (claim, data) => {
sendMatomoEvent('Media', 'BufferTimestamp', claim.claim_id, data.timeAtBuffer);
if (LBRY_WEB_BUFFER_API) {
fetch(LBRY_WEB_BUFFER_API, {
method: 'post',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
device: 'web',
type: 'buffering',
client: data.userId,
data: {
url: claim.canonical_url,
position: data.timeAtBuffer,
duration: data.bufferDuration,
player: data.playerPoweredBy,
readyState: data.readyState,
stream_duration: data.duration,
stream_bitrate: data.bitRate,
},
}),
});
}
},
playerLoadedEvent: embedded => {
playerLoadedEvent: (embedded) => {
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
},
playerStartedEvent: embedded => {
playerStartedEvent: (embedded) => {
sendMatomoEvent('Player', 'Started', embedded ? 'embedded' : 'onsite');
},
tagFollowEvent: (tag, following) => {
@@ -316,7 +446,7 @@ analytics.pageView(
// Listen for url changes and report
// This will include search queries
history.listen(location => {
history.listen((location) => {
const { pathname, search } = location;
const page = `${pathname}${search}`;
+35 -3
View File
@@ -4,17 +4,44 @@ import { COMMENT_SERVER_API } from 'config';
const Comments = {
url: COMMENT_SERVER_API,
enabled: Boolean(COMMENT_SERVER_API),
isCustomServer: false,
setServerUrl: (customUrl: ?string) => {
Comments.url = customUrl === undefined ? COMMENT_SERVER_API : customUrl;
Comments.enabled = Boolean(Comments.url);
Comments.isCustomServer = Comments.url !== COMMENT_SERVER_API;
},
moderation_block: (params: ModerationBlockParams) => fetchCommentsApi('moderation.Block', params),
moderation_unblock: (params: ModerationBlockParams) => fetchCommentsApi('moderation.UnBlock', params),
moderation_block_list: (params: ModerationBlockParams) => fetchCommentsApi('moderation.BlockedList', params),
moderation_add_delegate: (params: ModerationAddDelegateParams) => fetchCommentsApi('moderation.AddDelegate', params),
moderation_remove_delegate: (params: ModerationRemoveDelegateParams) =>
fetchCommentsApi('moderation.RemoveDelegate', params),
moderation_list_delegates: (params: ModerationListDelegatesParams) =>
fetchCommentsApi('moderation.ListDelegates', params),
moderation_am_i: (params: ModerationAmIParams) => fetchCommentsApi('moderation.AmI', params),
comment_list: (params: CommentListParams) => fetchCommentsApi('comment.List', params),
comment_abandon: (params: CommentAbandonParams) => fetchCommentsApi('comment.Abandon', params),
comment_create: (params: CommentCreateParams) => fetchCommentsApi('comment.Create', params),
comment_by_id: (params: CommentByIdParams) => fetchCommentsApi('comment.ByID', params),
comment_pin: (params: CommentPinParams) => fetchCommentsApi('comment.Pin', params),
comment_edit: (params: CommentEditParams) => fetchCommentsApi('comment.Edit', params),
reaction_list: (params: ReactionListParams) => fetchCommentsApi('reaction.List', params),
reaction_react: (params: ReactionReactParams) => fetchCommentsApi('reaction.React', params),
setting_list: (params: SettingsParams) => fetchCommentsApi('setting.List', params),
setting_block_word: (params: BlockWordParams) => fetchCommentsApi('setting.BlockWord', params),
setting_unblock_word: (params: BlockWordParams) => fetchCommentsApi('setting.UnBlockWord', params),
setting_list_blocked_words: (params: SettingsParams) => fetchCommentsApi('setting.ListBlockedWords', params),
setting_update: (params: UpdateSettingsParams) => fetchCommentsApi('setting.Update', params),
super_list: (params: SuperListParams) => fetchCommentsApi('comment.SuperChatList', params),
};
function fetchCommentsApi(method: string, params: {}) {
if (!Comments.enabled) {
return Promise.reject('Comments are not currently enabled'); // eslint-disable-line
if (!Comments.url) {
return Promise.reject(new Error('Commenting server is not set.'));
} else if (!Comments.enabled) {
return Promise.reject('Comments are not currently enabled.'); // eslint-disable-line
}
const url = `${Comments.url}?m=${method}`;
@@ -33,7 +60,12 @@ function fetchCommentsApi(method: string, params: {}) {
return fetch(url, options)
.then((res) => res.json())
.then((res) => res.result);
.then((res) => {
if (res.error) {
throw new Error(res.error.message);
}
return res.result;
});
}
export default Comments;
+1 -1
View File
@@ -30,6 +30,6 @@ export default function I18nMessage(props: Props) {
return (
// style={{height: iframeHeight}}
// ref={iframeRef}
<iframe src={src} title={title} onLoad={onLoad} />
<iframe src={src} title={title} onLoad={onLoad} sandbox={!IS_WEB} />
);
}
@@ -5,6 +5,7 @@ import ChannelThumbnail from 'component/channelThumbnail';
import { parseURI } from 'lbry-redux';
import ChannelBlockButton from 'component/channelBlockButton';
import ChannelMuteButton from 'component/channelMuteButton';
import SubscribeButton from 'component/subscribeButton';
type Props = {
uri: string,
@@ -30,6 +31,7 @@ function AbandonedChannelPreview(props: Props) {
<div className="section__actions">
<ChannelBlockButton uri={uri} />
<ChannelMuteButton uri={uri} />
<SubscribeButton uri={uri} />
</div>
</div>
</div>
+13 -2
View File
@@ -5,7 +5,14 @@ import { selectGetSyncErrorMessage, selectSyncFatalError } from 'redux/selectors
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
import { doFetchChannelListMine, selectMyChannelUrls, SETTINGS } from 'lbry-redux';
import {
doFetchChannelListMine,
doFetchCollectionListMine,
SETTINGS,
selectMyChannelUrls,
doResolveUris,
} from 'lbry-redux';
import { selectSubscriptions } from 'redux/selectors/subscriptions';
import {
makeSelectClientSetting,
selectLanguage,
@@ -27,7 +34,7 @@ import {
doSetActiveChannel,
doSetIncognito,
} from 'redux/actions/app';
import { doFetchModBlockedList } from 'redux/actions/comments';
import { doFetchModBlockedList, doFetchCommentModAmIList } from 'redux/actions/comments';
import App from './view';
const select = (state) => ({
@@ -47,11 +54,13 @@ const select = (state) => ({
syncFatalError: selectSyncFatalError(state),
activeChannelClaim: selectActiveChannelClaim(state),
myChannelUrls: selectMyChannelUrls(state),
subscriptions: selectSubscriptions(state),
});
const perform = (dispatch) => ({
fetchAccessToken: () => dispatch(doFetchAccessToken()),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()),
setLanguage: (language) => dispatch(doSetLanguage(language)),
signIn: () => dispatch(doSignIn()),
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
@@ -62,6 +71,8 @@ const perform = (dispatch) => ({
setActiveChannelIfNotSet: () => dispatch(doSetActiveChannel()),
setIncognito: () => dispatch(doSetIncognito()),
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
resolveUris: (uris) => dispatch(doResolveUris(uris)),
fetchModAmIList: () => dispatch(doFetchCommentModAmIList()),
});
export default hot(connect(select, perform)(App));
+118 -44
View File
@@ -1,34 +1,27 @@
// @flow
import * as PAGES from 'constants/pages';
import React, { useEffect, useRef, useState } from 'react';
import React, { useEffect, useRef, useState, useLayoutEffect } from 'react';
import { lazyImport } from 'util/lazyImport';
import classnames from 'classnames';
import analytics from 'analytics';
import { buildURI, parseURI } from 'lbry-redux';
import { SIMPLE_SITE } from 'config';
import Router from 'component/router/index';
import ModalRouter from 'modal/modalRouter';
import ReactModal from 'react-modal';
import { openContextMenu } from 'util/context-menu';
import useKonamiListener from 'util/enhanced-layout';
import Yrbl from 'component/yrbl';
import FileRenderFloating from 'component/fileRenderFloating';
import { withRouter } from 'react-router';
import usePrevious from 'effects/use-previous';
import Nag from 'component/common/nag';
import REWARDS from 'rewards';
import usePersistedState from 'effects/use-persisted-state';
import FileDrop from 'component/fileDrop';
import NagContinueFirstRun from 'component/nagContinueFirstRun';
import Spinner from 'component/spinner';
import SyncFatalError from 'component/syncFatalError';
import LANGUAGES from 'constants/languages';
// @if TARGET='app'
import useZoom from 'effects/use-zoom';
import useHistoryNav from 'effects/use-history-nav';
// @endif
// @if TARGET='web'
import OpenInAppLink from 'web/component/openInAppLink';
import YoutubeWelcome from 'web/component/youtubeReferralWelcome';
import NagDegradedPerformance from 'web/component/nag-degraded-performance';
import NagDataCollection from 'web/component/nag-data-collection';
import {
useDegradedPerformance,
STATUS_OK,
@@ -38,6 +31,35 @@ import {
} from 'web/effects/use-degraded-performance';
// @endif
import LANGUAGE_MIGRATIONS from 'constants/language-migrations';
const FileDrop = lazyImport(() => import('component/fileDrop' /* webpackChunkName: "secondary" */));
const ModalRouter = lazyImport(() => import('modal/modalRouter' /* webpackChunkName: "secondary" */));
const Nag = lazyImport(() => import('component/common/nag' /* webpackChunkName: "secondary" */));
const NagContinueFirstRun = lazyImport(() =>
import('component/nagContinueFirstRun' /* webpackChunkName: "secondary" */)
);
const OpenInAppLink = lazyImport(() => import('web/component/openInAppLink' /* webpackChunkName: "secondary" */));
// @if TARGET='web'
const NagDataCollection = lazyImport(() =>
import('web/component/nag-data-collection' /* webpackChunkName: "secondary" */)
);
const NagDegradedPerformance = lazyImport(() =>
import('web/component/nag-degraded-performance' /* webpackChunkName: "secondary" */)
);
const NagNoUser = lazyImport(() => import('web/component/nag-no-user' /* webpackChunkName: "nag-no-user" */));
const NagSunset = lazyImport(() => import('web/component/nag-sunset' /* webpackChunkName: "nag-no-user" */));
const YoutubeWelcome = lazyImport(() =>
import('web/component/youtubeReferralWelcome' /* webpackChunkName: "secondary" */)
);
// @endif
const SyncFatalError = lazyImport(() => import('component/syncFatalError' /* webpackChunkName: "syncFatalError" */));
const Yrbl = lazyImport(() => import('component/yrbl' /* webpackChunkName: "yrbl" */));
// ****************************************************************************
export const MAIN_WRAPPER_CLASS = 'main-wrapper';
export const IS_MAC = navigator.userAgent.indexOf('Mac OS X') !== -1;
@@ -60,6 +82,7 @@ type Props = {
},
fetchAccessToken: () => void,
fetchChannelListMine: () => void,
fetchCollectionListMine: () => void,
signIn: () => void,
requestDownloadUpgrade: () => void,
onSignedIn: () => void,
@@ -77,14 +100,16 @@ type Props = {
isAuthenticated: boolean,
socketConnect: () => void,
syncLoop: (?boolean) => void,
syncEnabled: boolean,
currentModal: any,
syncFatalError: boolean,
activeChannelClaim: ?ChannelClaim,
myChannelUrls: ?Array<string>,
subscriptions: Array<Subscription>,
setActiveChannelIfNotSet: () => void,
setIncognito: (boolean) => void,
fetchModBlockedList: () => void,
resolveUris: (Array<string>) => void,
fetchModAmIList: () => void,
};
function App(props: Props) {
@@ -93,6 +118,7 @@ function App(props: Props) {
user,
fetchAccessToken,
fetchChannelListMine,
fetchCollectionListMine,
signIn,
autoUpdateDownloaded,
isUpgradeAvailable,
@@ -116,6 +142,9 @@ function App(props: Props) {
setActiveChannelIfNotSet,
setIncognito,
fetchModBlockedList,
resolveUris,
subscriptions,
fetchModAmIList,
} = props;
const appRef = useRef();
@@ -133,12 +162,16 @@ function App(props: Props) {
// @endif
const { pathname, hash, search } = props.location;
const [upgradeNagClosed, setUpgradeNagClosed] = useState(false);
const [resolvedSubscriptions, setResolvedSubscriptions] = useState(false);
const [sidebarOpen] = usePersistedState('sidebar', true);
const [seenSunsestMessage, setSeenSunsetMessage] = usePersistedState('lbrytv-sunset', false);
const showUpgradeButton =
(autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable)) && !upgradeNagClosed;
// referral claiming
const referredRewardAvailable = rewards && rewards.some((reward) => reward.reward_type === REWARDS.TYPE_REFEREE);
const urlParams = new URLSearchParams(search);
const rawReferrerParam = urlParams.get('r');
const fromLbrytvParam = urlParams.get('sunset');
const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#');
const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`);
const userId = user && user.id;
@@ -147,6 +180,8 @@ function App(props: Props) {
const hasNoChannels = myChannelUrls && myChannelUrls.length === 0;
const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language];
const hasActiveChannelClaim = activeChannelClaim !== undefined;
const isPersonalized = !IS_WEB || hasVerifiedEmail;
const renderFiledrop = !IS_WEB || isAuthenticated;
let uri;
try {
@@ -232,8 +267,9 @@ function App(props: Props) {
// @if TARGET='app'
fetchChannelListMine(); // This is fetched after a user is signed in on web
fetchCollectionListMine();
// @endif
}, [appRef, fetchAccessToken, fetchChannelListMine]);
}, [appRef, fetchAccessToken, fetchChannelListMine, fetchCollectionListMine]);
useEffect(() => {
// $FlowFixMe
@@ -249,12 +285,22 @@ function App(props: Props) {
if (hasMyChannels) {
fetchModBlockedList();
fetchModAmIList();
}
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
useEffect(() => {
// $FlowFixMe
document.documentElement.setAttribute('lang', language);
}, [language]);
useEffect(() => {
if (!languages.includes(language)) {
setLanguage(language);
if (document && document.documentElement && LANGUAGES[language].length >= 3) {
document.documentElement.dir = LANGUAGES[language][2];
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [language, languages]);
@@ -334,6 +380,16 @@ function App(props: Props) {
}
}, [hasVerifiedEmail, signIn, hasSignedIn]);
// batch resolve subscriptions to be used by the sideNavigation component.
// add it here so that it only resolves the first time, despite route changes.
// useLayoutEffect because it has to be executed before the sideNavigation component requests them
useLayoutEffect(() => {
if (sidebarOpen && isPersonalized && subscriptions && !resolvedSubscriptions) {
setResolvedSubscriptions(true);
resolveUris(subscriptions.map((sub) => sub.uri));
}
}, [sidebarOpen, isPersonalized, resolvedSubscriptions, subscriptions, resolveUris, setResolvedSubscriptions]);
// @if TARGET='web'
useDegradedPerformance(setLbryTvApiStatus, user);
// @endif
@@ -342,7 +398,7 @@ function App(props: Props) {
// Require an internal-api user on lbry.tv
// This also prevents the site from loading in the un-authed state while we wait for internal-apis to return for the first time
// It's not needed on desktop since there is no un-authed state
if (!user) {
if (user === undefined) {
return (
<div className="main--empty">
<Spinner delayed />
@@ -352,7 +408,15 @@ function App(props: Props) {
// @endif
if (syncFatalError) {
return <SyncFatalError lbryTvApiStatus={lbryTvApiStatus} />;
return (
<React.Suspense fallback={null}>
<SyncFatalError
// @if TARGET='web'
lbryTvApiStatus={lbryTvApiStatus}
// @endif
/>
</React.Suspense>
);
}
return (
@@ -367,41 +431,51 @@ function App(props: Props) {
onContextMenu={IS_WEB ? undefined : (e) => openContextMenu(e)}
>
{IS_WEB && lbryTvApiStatus === STATUS_DOWN ? (
<Yrbl
className="main--empty"
title={__('lbry.tv is currently down')}
subtitle={__('My wheel broke, but the good news is that someone from LBRY is working on it.')}
/>
<React.Suspense fallback={null}>
<Yrbl
className="main--empty"
title={__('lbry.tv is currently down')}
subtitle={__('My wheel broke, but the good news is that someone from LBRY is working on it.')}
/>
</React.Suspense>
) : (
<React.Fragment>
<Router />
<ModalRouter />
<FileDrop />
<React.Suspense fallback={null}>
<ModalRouter />
{renderFiledrop && <FileDrop />}
</React.Suspense>
<FileRenderFloating />
{isEnhancedLayout && <Yrbl className="yrbl--enhanced" />}
<React.Suspense fallback={null}>
{isEnhancedLayout && <Yrbl className="yrbl--enhanced" />}
{/* @if TARGET='app' */}
{showUpgradeButton && (
<Nag
message={__('An upgrade is available.')}
actionText={__('Install Now')}
onClick={requestDownloadUpgrade}
onClose={() => setUpgradeNagClosed(true)}
/>
)}
{/* @endif */}
{/* @if TARGET='app' */}
{showUpgradeButton && (
<Nag
message={__('An upgrade is available.')}
actionText={__('Install Now')}
onClick={requestDownloadUpgrade}
onClose={() => setUpgradeNagClosed(true)}
/>
)}
{/* @endif */}
{/* @if TARGET='web' */}
<YoutubeWelcome />
{!shouldHideNag && <OpenInAppLink uri={uri} />}
{!shouldHideNag && <NagContinueFirstRun />}
{(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && (
<NagDegradedPerformance onClose={() => setLbryTvApiStatus(STATUS_OK)} />
)}
{lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
<NagDataCollection onClose={handleAnalyticsDismiss} />
)}
{/* @endif */}
{/* @if TARGET='web' */}
<YoutubeWelcome />
{!SIMPLE_SITE && !shouldHideNag && <OpenInAppLink uri={uri} />}
{!shouldHideNag && <NagContinueFirstRun />}
{fromLbrytvParam && !seenSunsestMessage && !shouldHideNag && (
<NagSunset email={hasVerifiedEmail} onClose={() => setSeenSunsetMessage(true)} />
)}
{(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && (
<NagDegradedPerformance onClose={() => setLbryTvApiStatus(STATUS_OK)} />
)}
{!SIMPLE_SITE && lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
<NagDataCollection onClose={handleAnalyticsDismiss} />
)}
{user === null && <NagNoUser />}
{/* @endif */}
</React.Suspense>
</React.Fragment>
)}
</div>
+16 -3
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
import { makeSelectClaimForUri, SETTINGS, COLLECTIONS_CONSTS, makeSelectNextUrlForCollectionAndUrl } from 'lbry-redux';
import { withRouter } from 'react-router';
import { makeSelectIsPlayerFloating, makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
import { makeSelectClientSetting } from 'redux/selectors/settings';
@@ -8,11 +8,24 @@ import AutoplayCountdown from './view';
import { selectModal } from 'redux/selectors/app';
/*
AutoplayCountdown does not fetch it's own next content to play, it relies on <RecommendedContent> being rendered. This is dumb but I'm just the guy who noticed
AutoplayCountdown does not fetch it's own next content to play, it relies on <RecommendedContent> being rendered.
This is dumb but I'm just the guy who noticed -kj
*/
const select = (state, props) => {
const nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
const { location } = props;
const { search } = location;
const urlParams = new URLSearchParams(search);
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
let nextRecommendedUri;
if (collectionId) {
nextRecommendedUri = makeSelectNextUrlForCollectionAndUrl(collectionId, props.uri)(state);
} else {
nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
}
return {
collectionId,
nextRecommendedUri,
nextRecommendedClaim: makeSelectClaimForUri(nextRecommendedUri)(state),
isFloating: makeSelectIsPlayerFloating(props.location)(state),
+11 -4
View File
@@ -6,18 +6,19 @@ import I18nMessage from 'component/i18nMessage';
import { formatLbryUrlForWeb } from 'util/url';
import { withRouter } from 'react-router';
import debounce from 'util/debounce';
import { COLLECTIONS_CONSTS } from 'lbry-redux';
const DEBOUNCE_SCROLL_HANDLER_MS = 150;
const CLASSNAME_AUTOPLAY_COUNTDOWN = 'autoplay-countdown';
type Props = {
history: { push: string => void },
history: { push: (string) => void },
nextRecommendedClaim: ?StreamClaim,
nextRecommendedUri: string,
isFloating: boolean,
doSetPlayingUri: ({ uri: ?string }) => void,
doPlayUri: string => void,
doPlayUri: (string) => void,
modal: { id: string, modalProps: {} },
collectionId?: string,
};
function AutoplayCountdown(props: Props) {
@@ -29,6 +30,7 @@ function AutoplayCountdown(props: Props) {
isFloating,
history: { push },
modal,
collectionId,
} = props;
const nextTitle = nextRecommendedClaim && nextRecommendedClaim.value && nextRecommendedClaim.value.title;
@@ -44,6 +46,11 @@ function AutoplayCountdown(props: Props) {
let navigateUrl;
if (nextTitle) {
navigateUrl = formatLbryUrlForWeb(nextRecommendedUri);
if (collectionId) {
const collectionParams = new URLSearchParams();
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
navigateUrl = navigateUrl + `?` + collectionParams.toString();
}
}
const doNavigate = useCallback(() => {
@@ -71,7 +78,7 @@ function AutoplayCountdown(props: Props) {
// Ensure correct 'setTimerPaused' on initial render.
setTimerPaused(shouldPauseAutoplay());
const handleScroll = debounce(e => {
const handleScroll = debounce((e) => {
setTimerPaused(shouldPauseAutoplay());
}, DEBOUNCE_SCROLL_HANDLER_MS);
+3 -2
View File
@@ -1,11 +1,12 @@
import Button from './view';
import React, { forwardRef } from 'react';
import { connect } from 'react-redux';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
pathname: state.router.location.pathname,
emailVerified: selectUserVerifiedEmail(state),
user: selectUser(state),
});
const ConnectedButton = connect(mapStateToProps)(Button);
+18 -8
View File
@@ -38,6 +38,7 @@ type Props = {
myref: any,
dispatch: any,
'aria-label'?: string,
user: ?User,
};
// use forwardRef to allow consumers to pass refs to the button content if they want to
@@ -69,10 +70,13 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
myref,
dispatch, // <button> doesn't know what to do with dispatch
pathname,
user,
authSrc,
...otherProps
} = props;
const disable = disabled || (user === null && requiresAuth);
const combinedClassName = classnames(
'button',
button
@@ -82,7 +86,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
'button--alt': button === 'alt',
'button--inverse': button === 'inverse',
'button--close': button === 'close',
'button--disabled': disabled,
'button--disabled': disable,
'button--link': button === 'link',
}
: 'button--no-style',
@@ -93,6 +97,9 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
const combinedRef = useCombinedRefs(ref, innerRef, myref);
const size = iconSize || (!label && !children) ? 18 : undefined; // Fall back to default
// Label can be a string or object ( use title instead )
const ariaLabel = description || (typeof label === 'string' ? label : title);
const content = (
<span className="button__content">
{icon && <Icon icon={icon} iconColor={iconColor} size={iconSize} />}
@@ -146,6 +153,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
className={combinedClassName}
title={title}
onClick={onClick}
aria-label={ariaLabel}
>
{content}
</a>
@@ -184,14 +192,15 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
return (
<NavLink
exact
onClick={e => {
onClick={(e) => {
e.stopPropagation();
}}
to={redirectUrl}
title={title || defaultTooltip}
disabled={disabled}
disabled={disable}
className={combinedClassName}
activeClassName={activeClass}
aria-label={ariaLabel}
>
{content}
</NavLink>
@@ -203,8 +212,8 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
exact
to={path}
title={title || defaultTooltip}
disabled={disabled}
onClick={e => {
disabled={disable}
onClick={(e) => {
e.stopPropagation();
if (onClick) {
onClick();
@@ -212,6 +221,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
}}
className={combinedClassName}
activeClassName={activeClass}
aria-label={ariaLabel}
{...otherProps}
>
{content}
@@ -220,15 +230,15 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
<button
ref={combinedRef}
title={title || defaultTooltip}
aria-label={description || label || title}
aria-label={ariaLabel}
className={combinedClassName}
onClick={e => {
onClick={(e) => {
if (onClick) {
e.stopPropagation();
onClick(e);
}
}}
disabled={disabled}
disabled={disable}
type={type}
{...otherProps}
>
+1
View File
@@ -111,6 +111,7 @@ class CardVerify extends React.Component {
CardVerify.stripeHandler = StripeCheckout.configure({
key: this.props.stripeKey,
});
if (this.hasPendingClick) {
this.showStripeDialog();
}
+1 -2
View File
@@ -1,10 +1,9 @@
import { connect } from 'react-redux';
import { makeSelectMetadataItemForUri, makeSelectClaimForUri, makeSelectStakedLevelForChannelUri } from 'lbry-redux';
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
import ChannelAbout from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
stakedLevel: makeSelectStakedLevelForChannelUri(props.uri)(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
+2 -3
View File
@@ -17,7 +17,6 @@ type Props = {
email: ?string,
website: ?string,
languages: Array<string>,
stakedLevel?: number,
};
const formatEmail = (email: string) => {
@@ -30,7 +29,7 @@ const formatEmail = (email: string) => {
};
function ChannelAbout(props: Props) {
const { claim, uri, description, email, website, languages, stakedLevel } = props;
const { claim, uri, description, email, website, languages } = props;
const claimId = claim && claim.claim_id;
return (
@@ -41,7 +40,7 @@ function ChannelAbout(props: Props) {
<>
<label>{__('Description')}</label>
<div className="media__info-text media__info-text--constrained">
<MarkdownPreview content={description} stakedLevel={stakedLevel} />
<MarkdownPreview content={description} />
</div>
</>
)}
+49 -6
View File
@@ -1,14 +1,57 @@
import { connect } from 'react-redux';
import { doCommentModUnBlock, doCommentModBlock } from 'redux/actions/comments';
import { makeSelectChannelIsBlocked, makeSelectUriIsBlockingOrUnBlocking } from 'redux/selectors/comments';
import { makeSelectClaimIdForUri } from 'lbry-redux';
import {
doCommentModUnBlock,
doCommentModBlock,
doCommentModBlockAsAdmin,
doCommentModUnBlockAsAdmin,
doCommentModUnBlockAsModerator,
doCommentModBlockAsModerator,
} from 'redux/actions/comments';
import {
makeSelectChannelIsBlocked,
makeSelectChannelIsAdminBlocked,
makeSelectChannelIsModeratorBlockedForCreator,
makeSelectUriIsBlockingOrUnBlocking,
makeSelectIsTogglingForDelegator,
} from 'redux/selectors/comments';
import { BLOCK_LEVEL } from 'constants/comment';
import ChannelBlockButton from './view';
const select = (state, props) => ({
isBlocked: makeSelectChannelIsBlocked(props.uri)(state),
isBlockingOrUnBlocking: makeSelectUriIsBlockingOrUnBlocking(props.uri)(state),
});
const select = (state, props) => {
let isBlocked;
let isToggling;
switch (props.blockLevel) {
default:
case BLOCK_LEVEL.SELF:
isBlocked = makeSelectChannelIsBlocked(props.uri)(state);
break;
case BLOCK_LEVEL.MODERATOR:
isBlocked = makeSelectChannelIsModeratorBlockedForCreator(props.uri, props.creatorUri)(state);
isToggling = makeSelectIsTogglingForDelegator(props.uri, props.creatorUri)(state);
break;
case BLOCK_LEVEL.ADMIN:
isBlocked = makeSelectChannelIsAdminBlocked(props.uri)(state);
break;
}
return {
isBlocked,
isToggling,
isBlockingOrUnBlocking: makeSelectUriIsBlockingOrUnBlocking(props.uri)(state),
creatorId: makeSelectClaimIdForUri(props.creatorUri)(state),
};
};
export default connect(select, {
doCommentModUnBlock,
doCommentModBlock,
doCommentModUnBlockAsAdmin,
doCommentModBlockAsAdmin,
doCommentModUnBlockAsModerator,
doCommentModBlockAsModerator,
})(ChannelBlockButton);
+71 -17
View File
@@ -1,41 +1,95 @@
// @flow
import React from 'react';
import Button from 'component/button';
import { BLOCK_LEVEL } from 'constants/comment';
import { parseURI } from 'lbry-redux';
type Props = {
uri: string,
blockLevel?: string,
creatorUri?: string,
isBlocked: boolean,
isBlockingOrUnBlocking: boolean,
doCommentModUnBlock: (string) => void,
doCommentModBlock: (string) => void,
isToggling: boolean,
doCommentModUnBlock: (string, boolean) => void,
doCommentModBlock: (string, boolean) => void,
doCommentModUnBlockAsAdmin: (string, string) => void,
doCommentModBlockAsAdmin: (string, string) => void,
doCommentModUnBlockAsModerator: (string, string, string) => void,
doCommentModBlockAsModerator: (string, string, string) => void,
};
function ChannelBlockButton(props: Props) {
const { uri, doCommentModUnBlock, doCommentModBlock, isBlocked, isBlockingOrUnBlocking } = props;
const {
uri,
blockLevel,
creatorUri,
doCommentModUnBlock,
doCommentModBlock,
doCommentModUnBlockAsAdmin,
doCommentModBlockAsAdmin,
doCommentModUnBlockAsModerator,
doCommentModBlockAsModerator,
isBlocked,
isBlockingOrUnBlocking,
isToggling,
} = props;
function handleClick() {
if (isBlocked) {
doCommentModUnBlock(uri);
} else {
doCommentModBlock(uri);
switch (blockLevel) {
default:
case BLOCK_LEVEL.SELF:
if (isBlocked) {
doCommentModUnBlock(uri, false);
} else {
doCommentModBlock(uri, false);
}
break;
case BLOCK_LEVEL.MODERATOR:
if (creatorUri) {
const { channelClaimId } = parseURI(creatorUri);
if (isBlocked) {
doCommentModUnBlockAsModerator(uri, channelClaimId, '');
} else {
doCommentModBlockAsModerator(uri, channelClaimId, '');
}
}
break;
case BLOCK_LEVEL.ADMIN:
if (isBlocked) {
doCommentModUnBlockAsAdmin(uri, '');
} else {
doCommentModBlockAsAdmin(uri, '');
}
break;
}
}
return (
<Button
button={isBlocked ? 'alt' : 'secondary'}
label={
isBlocked
function getButtonText(blockLevel) {
switch (blockLevel) {
default:
case BLOCK_LEVEL.SELF:
case BLOCK_LEVEL.ADMIN:
return isBlocked
? isBlockingOrUnBlocking
? __('Unblocking...')
: __('Unblock')
: isBlockingOrUnBlocking
? __('Blocking...')
: __('Block')
}
onClick={handleClick}
/>
);
: __('Block');
case BLOCK_LEVEL.MODERATOR:
if (isToggling) {
return isBlocked ? __('Unblocking...') : __('Blocking...');
} else {
return isBlocked ? __('Unblock') : __('Block');
}
}
}
return <Button button={isBlocked ? 'alt' : 'secondary'} label={getButtonText(blockLevel)} onClick={handleClick} />;
}
export default ChannelBlockButton;
+4 -4
View File
@@ -12,9 +12,9 @@ import {
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { withRouter } from 'react-router';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
import ChannelPage from './view';
import ChannelContent from './view';
const select = (state, props) => {
const { search } = props.location;
@@ -28,7 +28,7 @@ const select = (state, props) => {
channelIsBlocked: makeSelectChannelIsMuted(props.uri)(state),
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
isAuthenticated: selectUserVerifiedEmail(state),
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showMature: selectShowMatureContent(state),
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
};
};
@@ -37,4 +37,4 @@ const perform = (dispatch) => ({
doResolveUris: (uris, returnCachedUris) => dispatch(doResolveUris(uris, returnCachedUris)),
});
export default withRouter(connect(select, perform)(ChannelPage));
export default withRouter(connect(select, perform)(ChannelContent));
+36 -21
View File
@@ -1,5 +1,5 @@
// @flow
import { SHOW_ADS } from 'config';
import { SHOW_ADS, SIMPLE_SITE } from 'config';
import * as CS from 'constants/claim_search';
import * as ICONS from 'constants/icons';
import React, { Fragment } from 'react';
@@ -9,6 +9,7 @@ import Button from 'component/button';
import ClaimListDiscover from 'component/claimListDiscover';
import Ads from 'web/component/ads';
import Icon from 'component/common/icon';
import LivestreamLink from 'component/livestreamLink';
import { Form, FormField } from 'component/common/form';
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
import { lighthouse } from 'redux/actions/search';
@@ -25,12 +26,14 @@ type Props = {
channelIsBlackListed: boolean,
defaultPageSize?: number,
defaultInfiniteScroll?: Boolean,
claim: ?Claim,
claim: Claim,
isAuthenticated: boolean,
showMature: boolean,
tileLayout: boolean,
viewHiddenChannels: boolean,
doResolveUris: (Array<string>, boolean) => void,
claimType: string,
empty?: string,
};
function ChannelContent(props: Props) {
@@ -48,6 +51,8 @@ function ChannelContent(props: Props) {
tileLayout,
viewHiddenChannels,
doResolveUris,
claimType,
empty,
} = props;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
const [searchQuery, setSearchQuery] = React.useState('');
@@ -57,6 +62,7 @@ function ChannelContent(props: Props) {
} = useHistory();
const url = `${pathname}${search}`;
const claimId = claim && claim.claim_id;
const showFilters = !claimType || claimType === 'stream';
function handleInputChange(e) {
const { value } = e.target;
@@ -72,7 +78,7 @@ function ChannelContent(props: Props) {
lighthouse
.search(
`s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
!showMature ? '&nsfw=false&size=25&from=0' : ''
!showMature ? '&nsfw=false&size=50&from=0' : ''
}`
)
.then((results) => {
@@ -106,6 +112,8 @@ function ChannelContent(props: Props) {
<HiddenNsfwClaims uri={uri} />
)}
<LivestreamLink uri={uri} />
{!fetching && channelIsBlackListed && (
<section className="card card--section">
<p>
@@ -127,19 +135,25 @@ function ChannelContent(props: Props) {
{!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />}
{claim && claimsInChannel > 0 ? (
<ClaimListDiscover
showHiddenByUser={viewHiddenChannels}
forceShowReposts
tileLayout={tileLayout}
uris={searchResults}
channelIds={[claim.claim_id]}
feeAmount={CS.FEE_AMOUNT_ANY}
defaultOrderBy={CS.ORDER_BY_NEW}
pageSize={defaultPageSize}
infiniteScroll={defaultInfiniteScroll}
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
meta={
<ClaimListDiscover
hasSource
defaultFreshness={CS.FRESH_ALL}
showHiddenByUser={viewHiddenChannels}
forceShowReposts
hideFilters={!showFilters}
hideAdvancedFilter={!showFilters}
tileLayout={tileLayout}
uris={searchResults}
streamType={SIMPLE_SITE ? CS.CONTENT_ALL : undefined}
channelIds={[claimId]}
claimType={claimType}
feeAmount={CS.FEE_AMOUNT_ANY}
defaultOrderBy={CS.ORDER_BY_NEW}
pageSize={defaultPageSize}
infiniteScroll={defaultInfiniteScroll}
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
meta={
showFilters && (
<Form onSubmit={() => {}} className="wunderbar--inline">
<Icon icon={ICONS.SEARCH} />
<FormField
@@ -150,11 +164,12 @@ function ChannelContent(props: Props) {
placeholder={__('Search')}
/>
</Form>
}
/>
) : (
<section className="main--empty">{__("This channel hasn't published anything yet")}</section>
)}
)
}
isChannel
channelIsMine={channelIsMine}
empty={empty}
/>
</Fragment>
);
}
+1 -3
View File
@@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import ChannelDiscussion from './view';
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
@@ -8,10 +7,9 @@ import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
const linkedCommentId = urlParams.get('lc');
return {
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
linkedCommentId: urlParams.get('lc'),
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
};
};
+3 -3
View File
@@ -5,19 +5,19 @@ import Empty from 'component/common/empty';
type Props = {
uri: string,
linkedComment: ?any,
linkedCommentId?: string,
commentsDisabled: boolean,
};
function ChannelDiscussion(props: Props) {
const { uri, linkedComment, commentsDisabled } = props;
const { uri, linkedCommentId, commentsDisabled } = props;
if (commentsDisabled) {
return <Empty text={__('This channel has disabled comments on their page.')} />;
}
return (
<section className="section">
<CommentsList uri={uri} linkedComment={linkedComment} />
<CommentsList uri={uri} linkedCommentId={linkedCommentId} />
</section>
);
}
+2 -2
View File
@@ -17,7 +17,7 @@ import {
} from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
import { doUpdateBlockListForPublishedChannel } from 'redux/actions/comments';
import ChannelPage from './view';
import ChannelForm from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
@@ -52,4 +52,4 @@ const perform = (dispatch) => ({
clearChannelErrors: () => dispatch(doClearChannelErrors()),
});
export default connect(select, perform)(ChannelPage);
export default connect(select, perform)(ChannelForm);
+12 -11
View File
@@ -20,6 +20,8 @@ import analytics from 'analytics';
import LbcSymbol from 'component/common/lbc-symbol';
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
import { SIMPLE_SITE } from 'config';
import { sortLanguageMap } from 'util/default-languages';
const LANG_NONE = 'none';
@@ -358,8 +360,9 @@ function ChannelForm(props: Props) {
<Card
body={
<TagsSearch
suggestMature
suggestMature={!SIMPLE_SITE}
disableAutoFocus
disableControlTags
limitSelect={MAX_TAG_SELECT}
tagsPassedIn={params.tags || []}
label={__('Selected Tags')}
@@ -414,9 +417,9 @@ function ChannelForm(props: Props) {
<option key={'pri-langNone'} value={LANG_NONE}>
{__('None selected')}
</option>
{Object.keys(SUPPORTED_LANGUAGES).map((language) => (
<option key={language} value={language}>
{SUPPORTED_LANGUAGES[language]}
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
<option key={langKey} value={langKey}>
{langName}
</option>
))}
</FormField>
@@ -432,13 +435,11 @@ function ChannelForm(props: Props) {
<option key={'sec-langNone'} value={LANG_NONE}>
{__('None selected')}
</option>
{Object.keys(SUPPORTED_LANGUAGES)
.filter((lang) => lang !== languageParam[0])
.map((language) => (
<option key={language} value={language}>
{SUPPORTED_LANGUAGES[language]}
</option>
))}
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
<option key={langKey} value={langKey} disabled={langKey === languageParam[0]}>
{langName}
</option>
))}
</FormField>
</>
}
+3 -2
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doToggleMuteChannel } from 'redux/actions/blocked';
import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked';
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import ChannelMuteButton from './view';
@@ -8,5 +8,6 @@ const select = (state, props) => ({
});
export default connect(select, {
doToggleMuteChannel,
doChannelMute,
doChannelUnmute,
})(ChannelMuteButton);
+14 -9
View File
@@ -6,19 +6,24 @@ type Props = {
uri: string,
isMuted: boolean,
channelClaim: ?ChannelClaim,
doToggleMuteChannel: (string) => void,
doChannelMute: (string, boolean) => void,
doChannelUnmute: (string, boolean) => void,
};
function ChannelBlockButton(props: Props) {
const { uri, doToggleMuteChannel, isMuted } = props;
function ChannelMuteButton(props: Props) {
const { uri, doChannelMute, doChannelUnmute, isMuted } = props;
function handleClick() {
if (isMuted) {
doChannelUnmute(uri, false);
} else {
doChannelMute(uri, false);
}
}
return (
<Button
button={isMuted ? 'alt' : 'secondary'}
label={isMuted ? __('Unmute') : __('Mute')}
onClick={() => doToggleMuteChannel(uri)}
/>
<Button button={isMuted ? 'alt' : 'secondary'} label={isMuted ? __('Unmute') : __('Mute')} onClick={handleClick} />
);
}
export default ChannelBlockButton;
export default ChannelMuteButton;
+3 -3
View File
@@ -2,9 +2,9 @@ import { connect } from 'react-redux';
import { selectMyChannelClaims } from 'lbry-redux';
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
import SelectChannel from './view';
import ChannelSelector from './view';
const select = state => ({
const select = (state) => ({
channels: selectMyChannelClaims(state),
activeChannelClaim: selectActiveChannelClaim(state),
incognito: selectIncognito(state),
@@ -13,4 +13,4 @@ const select = state => ({
export default connect(select, {
doSetActiveChannel,
doSetIncognito,
})(SelectChannel);
})(ChannelSelector);
+1 -1
View File
@@ -30,7 +30,7 @@ function ChannelListItem(props: ListItemProps) {
return (
<div className={classnames('channel__list-item', { 'channel__list-item--selected': isSelected })}>
<ChannelThumbnail uri={uri} hideStakedIndicator />
<ChannelThumbnail uri={uri} hideStakedIndicator xsmall noLazyLoad />
<ChannelTitle uri={uri} />
{isSelected && <Icon icon={ICONS.DOWN} />}
</div>
+17 -6
View File
@@ -5,6 +5,8 @@ import classnames from 'classnames';
import Gerbil from './gerbil.png';
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
import ChannelStakedIndicator from 'component/channelStakedIndicator';
import OptimizedImage from 'component/optimizedImage';
import { AVATAR_DEFAULT } from 'config';
type Props = {
thumbnail: ?string,
@@ -13,11 +15,13 @@ type Props = {
thumbnailPreview: ?string,
obscure?: boolean,
small?: boolean,
xsmall?: boolean,
allowGifs?: boolean,
claim: ?ChannelClaim,
doResolveUri: (string) => void,
isResolving: boolean,
showDelayedMessage?: boolean,
noLazyLoad?: boolean,
hideStakedIndicator?: boolean,
};
@@ -29,11 +33,13 @@ function ChannelThumbnail(props: Props) {
thumbnailPreview: rawThumbnailPreview,
obscure,
small = false,
xsmall = false,
allowGifs = false,
claim,
doResolveUri,
isResolving,
showDelayedMessage = false,
noLazyLoad,
hideStakedIndicator = false,
} = props;
const [thumbError, setThumbError] = React.useState(false);
@@ -41,7 +47,10 @@ function ChannelThumbnail(props: Props) {
const thumbnail = rawThumbnail && rawThumbnail.trim().replace(/^http:\/\//i, 'https://');
const thumbnailPreview = rawThumbnailPreview && rawThumbnailPreview.trim().replace(/^http:\/\//i, 'https://');
const channelThumbnail = thumbnail || thumbnailPreview;
const isGif = channelThumbnail && channelThumbnail.endsWith('gif');
const showThumb = (!obscure && !!thumbnail) || thumbnailPreview;
const defaultAvater = AVATAR_DEFAULT || Gerbil;
// Generate a random color class based on the first letter of the channel name
const { channelName } = parseURI(uri);
let initializer;
@@ -59,27 +68,28 @@ function ChannelThumbnail(props: Props) {
}
}, [doResolveUri, shouldResolve, uri]);
if (channelThumbnail && channelThumbnail.endsWith('gif') && !allowGifs) {
if (isGif && !allowGifs) {
return (
<FreezeframeWrapper src={channelThumbnail} className={classnames('channel-thumbnail', className)}>
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
</FreezeframeWrapper>
);
}
return (
<div
className={classnames('channel-thumbnail', className, {
[colorClassName]: !showThumb,
'channel-thumbnail--small': small,
'channel-thumbnail--xsmall': xsmall,
'channel-thumbnail--resolving': isResolving,
})}
>
{!showThumb && (
<img
<OptimizedImage
alt={__('Channel profile picture')}
className="channel-thumbnail__default"
src={!thumbError && thumbnailPreview ? thumbnailPreview : Gerbil}
src={!thumbError && channelThumbnail ? channelThumbnail : defaultAvater}
loading={noLazyLoad ? undefined : 'lazy'}
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
/>
)}
@@ -88,10 +98,11 @@ function ChannelThumbnail(props: Props) {
{showDelayedMessage && thumbError ? (
<div className="chanel-thumbnail--waiting">{__('This will be visible in a few minutes.')}</div>
) : (
<img
<OptimizedImage
alt={__('Channel profile picture')}
className="channel-thumbnail__custom"
src={!thumbError ? thumbnailPreview || thumbnail : Gerbil}
src={!thumbError && channelThumbnail ? channelThumbnail : defaultAvater}
loading={noLazyLoad ? undefined : 'lazy'}
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
/>
)}
+12 -3
View File
@@ -6,13 +6,22 @@ import Button from 'component/button';
type Props = {
doOpenModal: (string, {}) => void,
claim: StreamClaim,
abandonActionCallback: any => void,
claim: Claim,
abandonActionCallback: (any) => void,
iconSize: number,
};
export default function ClaimAbandonButton(props: Props) {
const { doOpenModal, claim, abandonActionCallback } = props;
const { value_type } = claim || {};
let buttonLabel;
if (value_type === 'channel') {
buttonLabel = __('Delete Channel');
} else if (value_type === 'collection') {
buttonLabel = __('Delete List');
} else if (value_type === 'stream') {
buttonLabel = __('Delete Publish');
}
function abandonClaim() {
doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback });
@@ -21,7 +30,7 @@ export default function ClaimAbandonButton(props: Props) {
return (
<Button
disabled={!claim}
label={__('Delete Channel')}
label={buttonLabel}
button="alt"
iconColor="red"
icon={ICONS.DELETE}
@@ -1,9 +1,9 @@
import { connect } from 'react-redux';
import { makeSelectChannelForClaimUri } from 'lbry-redux';
import FileAuthor from './view';
import ClaimAuthor from './view';
const select = (state, props) => ({
channelUri: makeSelectChannelForClaimUri(props.uri)(state),
});
export default connect(select)(FileAuthor);
export default connect(select)(ClaimAuthor);
@@ -7,7 +7,7 @@ type Props = {
hideActions?: boolean,
};
function FileAuthor(props: Props) {
function ClaimAuthor(props: Props) {
const { channelUri, hideActions } = props;
return channelUri ? (
@@ -17,4 +17,4 @@ function FileAuthor(props: Props) {
);
}
export default FileAuthor;
export default ClaimAuthor;
+23
View File
@@ -0,0 +1,23 @@
import { connect } from 'react-redux';
import ClaimCollectionAdd from './view';
import { withRouter } from 'react-router';
import {
makeSelectClaimForUri,
doLocalCollectionCreate,
selectBuiltinCollections,
selectMyPublishedCollections,
selectMyUnpublishedCollections,
} from 'lbry-redux';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
builtin: selectBuiltinCollections(state),
published: selectMyPublishedCollections(state),
unpublished: selectMyUnpublishedCollections(state),
});
const perform = (dispatch) => ({
addCollection: (name, items, type) => dispatch(doLocalCollectionCreate(name, items, type)),
});
export default withRouter(connect(select, perform)(ClaimCollectionAdd));
+168
View File
@@ -0,0 +1,168 @@
// @flow
import React from 'react';
import type { ElementRef } from 'react';
import Button from 'component/button';
import Card from 'component/common/card';
import { FormField } from 'component/common/form';
import * as ICONS from 'constants/icons';
import CollectionSelectItem from 'component/collectionSelectItem';
type Props = {
claim: Claim,
builtin: any,
published: any,
unpublished: any,
addCollection: (string, Array<string>, string) => void,
closeModal: () => void,
uri: string,
};
const ClaimCollectionAdd = (props: Props) => {
const { builtin, published, unpublished, addCollection, claim, closeModal, uri } = props;
const buttonref: ElementRef<any> = React.useRef();
const permanentUrl = claim && claim.permanent_url;
const isChannel = claim && claim.value_type === 'channel';
const [addNewCollection, setAddNewCollection] = React.useState(false);
const [newCollectionName, setNewCollectionName] = React.useState('');
// TODO: when other collection types added, filter list in context
// const isPlayable =
// claim &&
// claim.value &&
// // $FlowFixMe
// claim.value.stream_type &&
// (claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
function handleNameInput(e) {
const { value } = e.target;
setNewCollectionName(value);
}
function handleAddCollection() {
addCollection(newCollectionName, [permanentUrl], isChannel ? 'collection' : 'playlist');
setNewCollectionName('');
setAddNewCollection(false);
}
function altEnterListener(e: SyntheticKeyboardEvent<*>) {
const KEYCODE_ENTER = 13;
if (e.keyCode === KEYCODE_ENTER) {
e.preventDefault();
buttonref.current.click();
}
}
function onTextareaFocus() {
window.addEventListener('keydown', altEnterListener);
}
function onTextareaBlur() {
window.removeEventListener('keydown', altEnterListener);
}
function handleClearNew() {
setNewCollectionName('');
setAddNewCollection(false);
}
return (
<Card
title={__('Add To...')}
actions={
<div className="card__body">
{uri && (
<fieldset-section>
<div className={'card__body-scrollable'}>
{(Object.values(builtin): any)
// $FlowFixMe
.filter((list) => (isChannel ? list.type === 'collection' : list.type === 'playlist'))
.map((l) => {
const { id } = l;
return (
<CollectionSelectItem
claim={claim}
collectionId={id}
uri={permanentUrl}
key={id}
category={'builtin'}
/>
);
})}
{unpublished &&
(Object.values(unpublished): any)
// $FlowFixMe
.filter((list) => (isChannel ? list.type === 'collection' : list.type === 'playlist'))
.map((l) => {
const { id } = l;
return (
<CollectionSelectItem
claim={claim}
collectionId={id}
uri={permanentUrl}
key={id}
category={'unpublished'}
/>
);
})}
{published &&
(Object.values(published): any).map((l) => {
// $FlowFixMe
const { id } = l;
return (
<CollectionSelectItem
claim={claim}
collectionId={id}
uri={permanentUrl}
key={id}
category={'published'}
/>
);
})}
</div>
</fieldset-section>
)}
<fieldset-section>
{addNewCollection && (
<FormField
autoFocus
type="text"
name="new_collection"
value={newCollectionName}
label={__('New List Title')}
onFocus={onTextareaFocus}
onBlur={onTextareaBlur}
inputButton={
<>
<Button
button={'alt'}
icon={ICONS.ADD}
className={'button-toggle'}
disabled={!newCollectionName.length}
onClick={() => handleAddCollection()}
ref={buttonref}
/>
<Button
button={'alt'}
className={'button-toggle'}
icon={ICONS.REMOVE}
onClick={() => handleClearNew()}
/>
</>
}
onChange={handleNameInput}
/>
)}
{!addNewCollection && (
<Button button={'link'} label={__('New List')} onClick={() => setAddNewCollection(true)} />
)}
</fieldset-section>
<div className="card__actions">
<Button button="secondary" label={__('Done')} disabled={addNewCollection} onClick={closeModal} />
</div>
</div>
}
/>
);
};
export default ClaimCollectionAdd;
@@ -0,0 +1,18 @@
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import CollectionAddButton from './view';
import { makeSelectClaimForUri, makeSelectClaimUrlInCollection } from 'lbry-redux';
const select = (state, props) => {
const claim = makeSelectClaimForUri(props.uri)(state);
const permanentUrl = claim && claim.permanent_url;
return {
claim,
isSaved: makeSelectClaimUrlInCollection(permanentUrl)(state),
};
};
export default connect(select, {
doOpenModal,
})(CollectionAddButton);
@@ -0,0 +1,41 @@
// @flow
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
import classnames from 'classnames';
type Props = {
uri: string,
doOpenModal: (string, {}) => void,
fileAction?: boolean,
type?: boolean,
claim: Claim,
isSaved: boolean,
};
export default function CollectionAddButton(props: Props) {
const { doOpenModal, uri, fileAction, type = 'playlist', claim, isSaved } = props;
// $FlowFixMe
const streamType = (claim && claim.value && claim.value.stream_type) || '';
const isPlayable = streamType === 'video' || streamType === 'audio';
if (!isPlayable) return null;
return (
<Button
button={fileAction ? undefined : 'alt'}
className={classnames({ 'button--file-action': fileAction })}
icon={fileAction ? (!isSaved ? ICONS.ADD : ICONS.STACK) : ICONS.LIBRARY}
iconSize={fileAction ? 22 : undefined}
label={uri ? (!isSaved ? __('Save') : __('Saved')) : __('New List')}
requiresAuth={IS_WEB}
title={__('Add this claim to a list')}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
doOpenModal(MODALS.COLLECTION_ADD, { uri, type });
}}
/>
);
}
+24 -4
View File
@@ -5,6 +5,7 @@ import EmbedPlayButton from 'component/embedPlayButton';
import Button from 'component/button';
import UriIndicator from 'component/uriIndicator';
import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view';
import { SIMPLE_SITE } from 'config';
type Props = {
uri: string,
@@ -12,7 +13,7 @@ type Props = {
children: React.Node,
description: ?string,
isResolvingUri: boolean,
doResolveUri: string => void,
doResolveUri: (string) => void,
blackListedOutpoints: Array<{
txid: string,
nout: number,
@@ -20,6 +21,7 @@ type Props = {
playingUri: ?PlayingUri,
parentCommentId?: string,
isMarkdownPost?: boolean,
allowPreview: boolean,
};
class ClaimLink extends React.Component<Props> {
@@ -29,6 +31,7 @@ class ClaimLink extends React.Component<Props> {
thumbnail: null,
description: null,
isResolvingUri: false,
allowPreview: false,
};
componentDidMount() {
@@ -46,7 +49,7 @@ class ClaimLink extends React.Component<Props> {
let blackListed = false;
blackListed = blackListedOutpoints.some(
outpoint =>
(outpoint) =>
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
);
@@ -63,7 +66,16 @@ class ClaimLink extends React.Component<Props> {
};
render() {
const { uri, claim, children, isResolvingUri, playingUri, parentCommentId, isMarkdownPost } = this.props;
const {
uri,
claim,
children,
isResolvingUri,
playingUri,
parentCommentId,
isMarkdownPost,
allowPreview,
} = this.props;
const isUnresolved = (!isResolvingUri && !claim) || !claim;
const isBlacklisted = this.isClaimBlackListed();
const isPlayingInline =
@@ -81,7 +93,7 @@ class ClaimLink extends React.Component<Props> {
return isChannel ? (
<UriIndicator uri={uri} link />
) : (
) : allowPreview ? (
<div className={classnames('claim-link')}>
<div
className={classnames({
@@ -92,6 +104,14 @@ class ClaimLink extends React.Component<Props> {
</div>
<Button button="link" className="preview-link__url" label={uri} navigate={uri} />
</div>
) : (
<Button
button="link"
title={SIMPLE_SITE ? __("This channel isn't staking enough LBRY Credits for link previews.") : children}
label={children}
className="button--external-link"
navigate={uri}
/>
);
}
}
+4 -4
View File
@@ -1,12 +1,12 @@
import { connect } from 'react-redux';
import ClaimList from './view';
import { SETTINGS } from 'lbry-redux';
import { SETTINGS, selectClaimSearchByQuery, selectClaimsByUri } from 'lbry-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
const select = (state) => ({
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
claimSearchByQuery: selectClaimSearchByQuery(state),
claimsByUri: selectClaimsByUri(state),
});
const perform = (dispatch) => ({});
export default connect(select, perform)(ClaimList);
export default connect(select)(ClaimList);
+78 -24
View File
@@ -9,6 +9,7 @@ import { FormField } from 'component/common/form';
import usePersistedState from 'effects/use-persisted-state';
import debounce from 'util/debounce';
import ClaimPreviewTile from 'component/claimPreviewTile';
import { prioritizeActiveLivestreams } from 'component/claimTilesDiscover/view';
const DEBOUNCE_SCROLL_HANDLER_MS = 150;
const SORT_NEW = 'new';
@@ -20,6 +21,7 @@ type Props = {
headerAltControls: Node,
loading: boolean,
type: string,
activeUri?: string,
empty?: string,
defaultSort?: boolean,
onScrollBottom?: (any) => void,
@@ -30,21 +32,31 @@ type Props = {
persistedStorageKey?: string,
showHiddenByUser: boolean,
showUnresolvedClaims?: boolean,
renderProperties: ?(Claim) => Node,
renderActions?: (Claim) => ?Node,
renderProperties?: (Claim) => ?Node,
includeSupportAction?: boolean,
injectedItem: ?Node,
timedOutMessage?: Node,
tileLayout?: boolean,
renderActions?: (Claim) => ?Node,
searchInLanguage: boolean,
hideMenu?: boolean,
claimSearchByQuery: { [string]: Array<string> },
claimsByUri: { [string]: any },
liveLivestreamsFirst?: boolean,
livestreamMap?: { [string]: any },
searchOptions?: any,
collectionId?: string,
showNoSourceClaims?: boolean,
onClick?: (e: any, index?: number) => void,
};
export default function ClaimList(props: Props) {
const {
activeUri,
uris,
headerAltControls,
loading,
id,
persistedStorageKey,
empty,
defaultSort,
@@ -55,28 +67,55 @@ export default function ClaimList(props: Props) {
page,
showHiddenByUser,
showUnresolvedClaims,
renderProperties,
includeSupportAction,
injectedItem,
timedOutMessage,
tileLayout = false,
renderActions,
renderProperties,
searchInLanguage,
hideMenu,
claimSearchByQuery,
claimsByUri,
liveLivestreamsFirst,
livestreamMap,
searchOptions,
collectionId,
showNoSourceClaims,
onClick,
} = props;
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
const timedOut = uris === null;
const urisLength = (uris && uris.length) || 0;
const liveUris = [];
if (liveLivestreamsFirst && livestreamMap) {
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, searchOptions);
}
const sortedUris = (urisLength > 0 && (currentSort === SORT_NEW ? uris : uris.slice().reverse())) || [];
const noResultMsg = searchInLanguage
? __('No results. Contents may be hidden by the Language filter.')
: __('No results');
const resolveLive = (index) => {
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
return true;
}
return undefined;
};
function handleSortChange() {
setCurrentSort(currentSort === SORT_NEW ? SORT_OLD : SORT_NEW);
}
function handleClaimClicked(e, index) {
if (onClick) {
onClick(e, index);
}
}
useEffect(() => {
const handleScroll = debounce((e) => {
if (page && pageSize && onScrollBottom) {
@@ -101,7 +140,17 @@ export default function ClaimList(props: Props) {
return tileLayout && !header ? (
<section className="claim-grid">
{urisLength > 0 &&
uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} showHiddenByUser={showHiddenByUser} />)}
uris.map((uri, index) => (
<ClaimPreviewTile
key={uri}
uri={uri}
showHiddenByUser={showHiddenByUser}
properties={renderProperties}
live={resolveLive(index)}
collectionId={collectionId}
showNoSourceClaims={showNoSourceClaims}
/>
))}
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
</section>
@@ -117,21 +166,23 @@ export default function ClaimList(props: Props) {
<div className={classnames('claim-list__header', { 'section__title--small': type === 'small' })}>
{header}
{loading && <Spinner type="small" />}
<div className="claim-list__alt-controls">
{headerAltControls}
{defaultSort && (
<FormField
className="claim-list__dropdown"
type="select"
name="file_sort"
value={currentSort}
onChange={handleSortChange}
>
<option value={SORT_NEW}>{__('Newest First')}</option>
<option value={SORT_OLD}>{__('Oldest First')}</option>
</FormField>
)}
</div>
{(headerAltControls || defaultSort) && (
<div className="claim-list__alt-controls">
{headerAltControls}
{defaultSort && (
<FormField
className="claim-list__dropdown"
type="select"
name="file_sort"
value={currentSort}
onChange={handleSortChange}
>
<option value={SORT_NEW}>{__('Newest First')}</option>
<option value={SORT_OLD}>{__('Oldest First')}</option>
</FormField>
)}
</div>
)}
</div>
)}
</React.Fragment>
@@ -149,7 +200,10 @@ export default function ClaimList(props: Props) {
{injectedItem && index === 4 && <li>{injectedItem}</li>}
<ClaimPreview
uri={uri}
containerId={id}
indexInContainer={index}
type={type}
active={activeUri && uri === activeUri}
hideMenu={hideMenu}
includeSupportAction={includeSupportAction}
showUnresolvedClaim={showUnresolvedClaims}
@@ -157,16 +211,16 @@ export default function ClaimList(props: Props) {
renderActions={renderActions}
showUserBlocked={showHiddenByUser}
showHiddenByUser={showHiddenByUser}
collectionId={collectionId}
showNoSourceClaims={showNoSourceClaims}
customShouldHide={(claim: StreamClaim) => {
// Hack to hide spee.ch thumbnail publishes
// If it meets these requirements, it was probably uploaded here:
// https://github.com/lbryio/lbry-redux/blob/master/src/redux/actions/publish.js#L74-L79
if (claim.name.length === 24 && !claim.name.includes(' ') && claim.value.author === 'Spee.ch') {
return true;
} else {
return false;
}
return claim.name.length === 24 && !claim.name.includes(' ') && claim.value.author === 'Spee.ch';
}}
live={resolveLive(index)}
onClick={handleClaimClicked}
/>
</React.Fragment>
))}
+2 -2
View File
@@ -9,7 +9,7 @@ import {
import { selectFollowedTags } from 'redux/selectors/tags';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
import { selectModerationBlockList } from 'redux/selectors/comments';
import ClaimListDiscover from './view';
@@ -18,7 +18,7 @@ const select = (state) => ({
claimSearchByQuery: selectClaimSearchByQuery(state),
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
loading: selectFetchingClaimSearch(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showNsfw: selectShowMatureContent(state),
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
languageSetting: selectLanguage(state),
mutedUris: selectMutedChannels(state),
+131 -28
View File
@@ -1,10 +1,11 @@
// @flow
import { ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
import type { Node } from 'react';
import * as CS from 'constants/claim_search';
import React from 'react';
import usePersistedState from 'effects/use-persisted-state';
import { withRouter } from 'react-router';
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
import { createNormalizedClaimSearchKey, MATURE_TAGS, splitBySeparator } from 'lbry-redux';
import Button from 'component/button';
import moment from 'moment';
import ClaimList from 'component/claimList';
@@ -13,9 +14,12 @@ import ClaimPreviewTile from 'component/claimPreviewTile';
import I18nMessage from 'component/i18nMessage';
import ClaimListHeader from 'component/claimListHeader';
import { useIsLargeScreen } from 'effects/use-screensize';
import { getLivestreamOnlyOptions } from 'util/search';
type Props = {
uris: Array<string>,
showHeader: boolean,
type: string,
subscribedChannels: Array<Subscription>,
doClaimSearch: ({}) => void,
loading: boolean,
@@ -45,7 +49,7 @@ type Props = {
headerLabel?: string | Node,
name?: string,
hideAdvancedFilter?: boolean,
claimType?: Array<string>,
claimType?: string | Array<string>,
defaultClaimType?: Array<string>,
streamType?: string | Array<string>,
defaultStreamType?: string | Array<string>,
@@ -65,12 +69,22 @@ type Props = {
searchInLanguage: boolean,
scrollAnchor?: string,
showHiddenByUser?: boolean,
liveLivestreamsFirst?: boolean,
livestreamMap?: { [string]: any },
hasSource?: boolean,
limitClaimsPerChannel?: number,
releaseTime?: string,
showNoSourceClaims?: boolean,
isChannel?: boolean,
empty?: string,
};
function ClaimListDiscover(props: Props) {
const {
doClaimSearch,
claimSearchByQuery,
showHeader = true,
type,
claimSearchByQueryLastPageReached,
tags,
defaultTags,
@@ -92,8 +106,8 @@ function ClaimListDiscover(props: Props) {
claimType,
pageSize,
defaultClaimType,
streamType,
defaultStreamType,
streamType = SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
defaultStreamType = SIMPLE_SITE ? CS.FILE_VIDEO : undefined, // add param for DEFAULT_STREAM_TYPE
freshness,
defaultFreshness = CS.FRESH_WEEK,
renderProperties,
@@ -112,13 +126,22 @@ function ClaimListDiscover(props: Props) {
forceShowReposts = false,
languageSetting,
searchInLanguage,
limitClaimsPerChannel,
releaseTime,
scrollAnchor,
showHiddenByUser = false,
liveLivestreamsFirst,
livestreamMap,
hasSource,
isChannel = false,
showNoSourceClaims,
empty,
} = props;
const didNavigateForward = history.action === 'PUSH';
const { search } = location;
const [page, setPage] = React.useState(1);
const [forceRefresh, setForceRefresh] = React.useState();
const [finalUris, setFinalUris] = React.useState([]);
const isLargeScreen = useIsLargeScreen();
const [orderParamEntry, setOrderParamEntry] = usePersistedState(`entry-${location.pathname}`, CS.ORDER_BY_TRENDING);
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
@@ -129,7 +152,9 @@ function ClaimListDiscover(props: Props) {
(urlParams.get(CS.TAGS_KEY) !== null && urlParams.get(CS.TAGS_KEY)) ||
(defaultTags && getParamFromTags(defaultTags));
const freshnessParam = freshness || urlParams.get(CS.FRESH_KEY) || defaultFreshness;
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
const mutedAndBlockedChannelIds = Array.from(
new Set(mutedUris.concat(blockedUris).map((uri) => splitBySeparator(uri)[1]))
);
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
const languageParams = searchInLanguage
@@ -157,7 +182,7 @@ function ClaimListDiscover(props: Props) {
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
const historyAction = history.action;
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy || orderParamEntry;
if (!orderParam) {
if (historyAction === 'POP') {
@@ -190,15 +215,18 @@ function ClaimListDiscover(props: Props) {
not_tags: Array<string>,
channel_ids?: Array<string>,
claim_ids?: Array<string>,
not_channel_ids: Array<string>,
not_channel_ids?: Array<string>,
order_by: Array<string>,
release_time?: string,
claim_type?: Array<string>,
claim_type?: string | Array<string>,
name?: string,
duration?: string,
reposted_claim_id?: string,
stream_types?: any,
fee_amount?: string,
has_source?: boolean,
has_no_source?: boolean,
limit_claims_per_channel?: number,
} = {
page_size: dynamicPageSize,
page,
@@ -207,9 +235,7 @@ function ClaimListDiscover(props: Props) {
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
// it's faster, but we will need to remove it if we start using total_pages
no_totals: true,
not_channel_ids:
// If channelIdsParam were passed in, we don't need not_channel_ids
!channelIdsParam ? mutedAndBlockedChannelIds : [],
not_channel_ids: isChannel ? undefined : mutedAndBlockedChannelIds,
not_tags: !showNsfw ? MATURE_TAGS : [],
order_by:
orderParam === CS.ORDER_BY_TRENDING
@@ -219,6 +245,14 @@ function ClaimListDiscover(props: Props) {
: CS.ORDER_BY_TOP_VALUE, // Sort by top
};
if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === CS.CLAIM_STREAM))) {
options.has_source = true;
}
if (limitClaimsPerChannel) {
options.limit_claims_per_channel = limitClaimsPerChannel;
}
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
options.fee_amount = feeAmountParam;
}
@@ -247,8 +281,10 @@ function ClaimListDiscover(props: Props) {
// SDK chokes on reposted_claim_id of null or false, needs to not be present if no value
options.reposted_claim_id = repostedClaimId;
}
if (claimType !== CS.CLAIM_CHANNEL) {
// IF release time, set it, else set fallback release times using the hack below.
if (releaseTime) {
options.release_time = releaseTime;
} else if (claimType !== CS.CLAIM_CHANNEL) {
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
@@ -283,7 +319,7 @@ function ClaimListDiscover(props: Props) {
}
if (streamTypeParam && streamTypeParam !== CS.CONTENT_ALL && claimType !== CS.CLAIM_CHANNEL) {
options.stream_types = [streamTypeParam];
options.stream_types = typeof streamTypeParam === 'string' ? [streamTypeParam] : streamTypeParam;
}
if (claimTypeParam) {
@@ -325,9 +361,31 @@ function ClaimListDiscover(props: Props) {
}
const hasMatureTags = tagsParam && tagsParam.split(',').some((t) => MATURE_TAGS.includes(t));
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
const mainSearchKey = createNormalizedClaimSearchKey(options);
let claimSearchResult = claimSearchByQuery[mainSearchKey];
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[mainSearchKey];
// uncomment to fix an item on a page
// const fixUri = 'lbry://@corbettreport#0/lbryodysee#5';
// if (
// orderParam === CS.ORDER_BY_NEW &&
// claimSearchResult &&
// claimSearchResult.length > 2 &&
// window.location.pathname === '/$/rabbithole'
// ) {
// if (claimSearchResult.indexOf(fixUri) !== -1) {
// claimSearchResult.splice(claimSearchResult.indexOf(fixUri), 1);
// } else {
// claimSearchResult.pop();
// }
// claimSearchResult.splice(2, 0, fixUri);
// }
const livestreamSearchKey = liveLivestreamsFirst
? createNormalizedClaimSearchKey(getLivestreamOnlyOptions(options))
: undefined;
const livestreamSearchResult = livestreamSearchKey && claimSearchByQuery[livestreamSearchKey];
const [prevOptions, setPrevOptions] = React.useState(null);
@@ -431,13 +489,43 @@ function ClaimListDiscover(props: Props) {
}
}
function urisEqual(prev: Array<string>, next: Array<string>) {
if (!prev || !next) {
// From 'ClaimList', "null" and "undefined" have special meaning,
// so we can't just compare array length here.
// - null = "timed out"
// - undefined = "no result".
return prev === next;
}
return prev.length === next.length && prev.every((value, index) => value === next[index]);
}
React.useEffect(() => {
if (shouldPerformSearch) {
const searchOptions = JSON.parse(optionsStringForEffect);
doClaimSearch(searchOptions);
if (liveLivestreamsFirst && options.page === 1) {
doClaimSearch(getLivestreamOnlyOptions(searchOptions));
}
}
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, forceRefresh]);
// Resolve 'finalUri'
React.useEffect(() => {
if (uris) {
if (!urisEqual(uris, finalUris)) {
setFinalUris(uris);
}
} else {
// Wait until all queries are done before updating the uris to avoid layout shifts.
const pending = claimSearchResult === undefined || (liveLivestreamsFirst && livestreamSearchResult === undefined);
if (!pending && !urisEqual(claimSearchResult, finalUris)) {
setFinalUris(claimSearchResult);
}
}
}, [uris, claimSearchResult, finalUris, setFinalUris, liveLivestreamsFirst, livestreamSearchResult]);
const headerToUse = header || (
<ClaimListHeader
channelIds={channelIds}
@@ -448,7 +536,7 @@ function ClaimListDiscover(props: Props) {
claimType={claimType}
streamType={streamType}
defaultStreamType={defaultStreamType}
feeAmount={feeAmount}
feeAmount={feeAmount} // ENABLE_PAID_CONTENT_DISCOVER or something
orderBy={orderBy}
defaultOrderBy={defaultOrderBy}
hideAdvancedFilter={hideAdvancedFilter}
@@ -474,9 +562,9 @@ function ClaimListDiscover(props: Props) {
)}
<ClaimList
tileLayout
id={claimSearchCacheQuery}
id={mainSearchKey}
loading={loading}
uris={uris || claimSearchResult}
uris={finalUris}
onScrollBottom={handleScrollBottom}
page={page}
pageSize={dynamicPageSize}
@@ -485,6 +573,11 @@ function ClaimListDiscover(props: Props) {
includeSupportAction={includeSupportAction}
injectedItem={injectedItem}
showHiddenByUser={showHiddenByUser}
liveLivestreamsFirst={liveLivestreamsFirst}
livestreamMap={livestreamMap}
searchOptions={options}
showNoSourceClaims={showNoSourceClaims}
empty={empty}
/>
{loading && (
<div className="claim-grid">
@@ -496,15 +589,17 @@ function ClaimListDiscover(props: Props) {
</div>
) : (
<div>
<div className="section__header--actions">
{headerToUse}
{meta && <div className="section__actions--no-margin">{meta}</div>}
</div>
{showHeader && (
<div className="section__header--actions">
{headerToUse}
{meta && <div className="section__actions--no-margin">{meta}</div>}
</div>
)}
<ClaimList
id={claimSearchCacheQuery}
id={mainSearchKey}
type={type}
loading={loading}
uris={uris || claimSearchResult}
uris={finalUris}
onScrollBottom={handleScrollBottom}
page={page}
pageSize={dynamicPageSize}
@@ -513,8 +608,16 @@ function ClaimListDiscover(props: Props) {
includeSupportAction={includeSupportAction}
injectedItem={injectedItem}
showHiddenByUser={showHiddenByUser}
liveLivestreamsFirst={liveLivestreamsFirst}
livestreamMap={livestreamMap}
searchOptions={options}
showNoSourceClaims={showNoSourceClaims}
empty={empty}
/>
{loading && new Array(dynamicPageSize).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
{loading &&
new Array(dynamicPageSize)
.fill(1)
.map((x, i) => <ClaimPreview key={i} placeholder="loading" type={type} />)}
</div>
)}
</React.Fragment>
+3 -3
View File
@@ -2,14 +2,14 @@ import { connect } from 'react-redux';
import { selectFetchingClaimSearch, SETTINGS } from 'lbry-redux';
import { selectFollowedTags } from 'redux/selectors/tags';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
import { doSetClientSetting } from 'redux/actions/settings';
import ClaimListHeader from './view';
const select = state => ({
const select = (state) => ({
followedTags: selectFollowedTags(state),
loading: selectFetchingClaimSearch(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showNsfw: selectShowMatureContent(state),
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
languageSetting: selectLanguage(state),
});
+29 -22
View File
@@ -29,7 +29,7 @@ type Props = {
channelIds?: Array<string>,
tileLayout: boolean,
doSetClientSetting: (string, boolean, ?boolean) => void,
setPage: number => void,
setPage: (number) => void,
hideFilters: boolean,
searchInLanguage: boolean,
languageSetting: string,
@@ -74,7 +74,7 @@ function ClaimListHeader(props: Props) {
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ANY;
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL);
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL && claimType === CS.CLAIM_COLLECTION);
const isFiltered = () =>
Boolean(
urlParams.get(CS.FRESH_KEY) ||
@@ -144,7 +144,7 @@ function ClaimListHeader(props: Props) {
function buildUrl(delta) {
const newUrlParams = new URLSearchParams(location.search);
CS.KEYS.forEach(k => {
CS.KEYS.forEach((k) => {
// $FlowFixMe get() can return null
if (urlParams.get(k) !== null) newUrlParams.set(k, urlParams.get(k));
});
@@ -161,7 +161,11 @@ function ClaimListHeader(props: Props) {
}
break;
case CS.CONTENT_KEY:
if (delta.value === CS.CLAIM_CHANNEL || delta.value === CS.CLAIM_REPOST) {
if (
delta.value === CS.CLAIM_CHANNEL ||
delta.value === CS.CLAIM_REPOST ||
delta.value === CS.CLAIM_COLLECTION
) {
newUrlParams.delete(CS.DURATION_KEY);
newUrlParams.set(CS.CONTENT_KEY, delta.value);
} else if (delta.value === CS.CONTENT_ALL) {
@@ -212,13 +216,13 @@ function ClaimListHeader(props: Props) {
<>
<div className="claim-search__wrapper">
<div className="claim-search__top">
<div className="claim-search__menu-group">
{!hideFilters &&
CS.ORDER_BY_TYPES.map(type => (
{!hideFilters && (
<div className="claim-search__menu-group">
{CS.ORDER_BY_TYPES.map((type) => (
<Button
key={type}
button="alt"
onClick={e =>
onClick={(e) =>
handleChange({
key: CS.ORDER_BY_KEY,
value: type,
@@ -233,8 +237,8 @@ function ClaimListHeader(props: Props) {
label={__(toCapitalCase(type))}
/>
))}
</div>
</div>
)}
<div className="claim-search__menu-group">
{!hideAdvancedFilter && !SIMPLE_SITE && (
<Button
@@ -276,21 +280,23 @@ function ClaimListHeader(props: Props) {
name="trending_time"
label={__('How Fresh')}
value={freshnessParam}
onChange={e =>
onChange={(e) =>
handleChange({
key: CS.FRESH_KEY,
value: e.target.value,
})
}
>
{CS.FRESH_TYPES.map(time => (
{CS.FRESH_TYPES.map((time) => (
<option key={time} value={time}>
{/* i18fixme */}
{time === CS.FRESH_DAY && __('Today')}
{time !== CS.FRESH_ALL &&
time !== CS.FRESH_DEFAULT &&
time !== CS.FRESH_DAY &&
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */}
{
time !== CS.FRESH_ALL &&
time !== CS.FRESH_DEFAULT &&
time !== CS.FRESH_DAY &&
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */
}
{time === CS.FRESH_ALL && __('All time')}
{time === CS.FRESH_DEFAULT && __('Default')}
</option>
@@ -314,18 +320,19 @@ function ClaimListHeader(props: Props) {
name="claimType"
label={__('Content Type')}
value={contentTypeParam || CS.CONTENT_ALL}
onChange={e =>
onChange={(e) =>
handleChange({
key: CS.CONTENT_KEY,
value: e.target.value,
})
}
>
{CS.CONTENT_TYPES.map(type => {
{CS.CONTENT_TYPES.map((type) => {
if (type !== CS.CLAIM_CHANNEL || (type === CS.CLAIM_CHANNEL && !channelIdsParam)) {
return (
<option key={type} value={type}>
{/* i18fixme */}
{type === CS.CLAIM_COLLECTION && __('List')}
{type === CS.CLAIM_CHANNEL && __('Channel')}
{type === CS.CLAIM_REPOST && __('Repost')}
{type === CS.FILE_VIDEO && __('Video')}
@@ -358,7 +365,7 @@ function ClaimListHeader(props: Props) {
name="claimType"
label={__('Language')}
value={languageValue || CS.LANGUAGES_ALL}
onChange={e =>
onChange={(e) =>
handleChange({
key: CS.LANGUAGE_KEY,
value: e.target.value,
@@ -398,14 +405,14 @@ function ClaimListHeader(props: Props) {
)
}
value={durationParam || CS.DURATION_ALL}
onChange={e =>
onChange={(e) =>
handleChange({
key: CS.DURATION_KEY,
value: e.target.value,
})
}
>
{CS.DURATION_TYPES.map(dur => (
{CS.DURATION_TYPES.map((dur) => (
<option key={dur} value={dur}>
{/* i18fixme */}
{dur === CS.DURATION_SHORT && __('Short (< 4 minutes)')}
@@ -428,7 +435,7 @@ function ClaimListHeader(props: Props) {
type="select"
name="paidcontent"
value={feeAmountParam}
onChange={e =>
onChange={(e) =>
handleChange({
key: CS.FEE_AMOUNT_KEY,
value: e.target.value,
+91 -16
View File
@@ -1,20 +1,95 @@
import { connect } from 'react-redux';
import { makeSelectClaimForUri, makeSelectClaimIsMine } from 'lbry-redux';
import {
doCollectionEdit,
makeSelectClaimForUri,
makeSelectFileInfoForUri,
doPrepareEdit,
makeSelectCollectionForIdHasClaimUrl,
makeSelectCollectionIsMine,
COLLECTIONS_CONSTS,
makeSelectEditedCollectionForId,
makeSelectClaimIsMine,
} from 'lbry-redux';
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { doToggleMuteChannel } from 'redux/actions/blocked';
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
import ClaimPreview from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
channelIsMuted: makeSelectChannelIsMuted(props.uri)(state),
channelIsBlocked: makeSelectChannelIsBlocked(props.uri)(state),
});
export default connect(select, {
doToggleMuteChannel,
import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked';
import { doSetActiveChannel, doSetIncognito, doOpenModal } from 'redux/actions/app';
import {
doCommentModBlock,
doCommentModUnBlock,
})(ClaimPreview);
doCommentModBlockAsAdmin,
doCommentModUnBlockAsAdmin,
} from 'redux/actions/comments';
import {
selectHasAdminChannel,
makeSelectChannelIsBlocked,
makeSelectChannelIsAdminBlocked,
} from 'redux/selectors/comments';
import { doToast } from 'redux/actions/notifications';
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import ClaimPreview from './view';
import fs from 'fs';
const select = (state, props) => {
const claim = makeSelectClaimForUri(props.uri, false)(state);
const repostedClaim = claim && claim.reposted_claim;
const contentClaim = repostedClaim || claim;
const contentSigningChannel = contentClaim && contentClaim.signing_channel;
const contentPermanentUri = contentClaim && contentClaim.permanent_url;
const contentChannelUri = (contentSigningChannel && contentSigningChannel.permanent_url) || contentPermanentUri;
return {
claim,
repostedClaim,
contentClaim,
contentSigningChannel,
contentChannelUri,
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(
COLLECTIONS_CONSTS.WATCH_LATER_ID,
contentPermanentUri
)(state),
hasClaimInFavorites: makeSelectCollectionForIdHasClaimUrl(
COLLECTIONS_CONSTS.FAVORITES_ID,
contentPermanentUri
)(state),
channelIsMuted: makeSelectChannelIsMuted(contentChannelUri)(state),
channelIsBlocked: makeSelectChannelIsBlocked(contentChannelUri)(state),
fileInfo: makeSelectFileInfoForUri(contentPermanentUri)(state),
isSubscribed: makeSelectIsSubscribed(contentChannelUri, true)(state),
channelIsAdminBlocked: makeSelectChannelIsAdminBlocked(props.uri)(state),
isAdmin: selectHasAdminChannel(state),
claimInCollection: makeSelectCollectionForIdHasClaimUrl(props.collectionId, contentPermanentUri)(state),
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state),
isAuthenticated: Boolean(selectUserVerifiedEmail(state)),
};
};
const perform = (dispatch) => ({
prepareEdit: (publishData, uri, fileInfo) => {
if (publishData.signing_channel) {
dispatch(doSetIncognito(false));
dispatch(doSetActiveChannel(publishData.signing_channel.claim_id));
} else {
dispatch(doSetIncognito(true));
}
dispatch(doPrepareEdit(publishData, uri, fileInfo, fs));
},
doToast: (props) => dispatch(doToast(props)),
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
doChannelMute: (channelUri) => dispatch(doChannelMute(channelUri)),
doChannelUnmute: (channelUri) => dispatch(doChannelUnmute(channelUri)),
doCommentModBlock: (channelUri) => dispatch(doCommentModBlock(channelUri)),
doCommentModUnBlock: (channelUri) => dispatch(doCommentModUnBlock(channelUri)),
doCommentModBlockAsAdmin: (commenterUri, blockerId) => dispatch(doCommentModBlockAsAdmin(commenterUri, blockerId)),
doCommentModUnBlockAsAdmin: (commenterUri, blockerId) =>
dispatch(doCommentModUnBlockAsAdmin(commenterUri, blockerId)),
doChannelSubscribe: (subscription) => dispatch(doChannelSubscribe(subscription)),
doChannelUnsubscribe: (subscription) => dispatch(doChannelUnsubscribe(subscription)),
doCollectionEdit: (collection, props) => dispatch(doCollectionEdit(collection, props)),
});
export default connect(select, perform)(ClaimPreview);
+341 -34
View File
@@ -1,68 +1,230 @@
// @flow
import { URL, SHARE_DOMAIN_URL } from 'config';
import * as ICONS from 'constants/icons';
import * as PAGES from 'constants/pages';
import * as MODALS from 'constants/modal_types';
import React from 'react';
import classnames from 'classnames';
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
import Icon from 'component/common/icon';
import { generateShareUrl } from 'util/url';
import { generateShareUrl, generateRssUrl, generateLbryContentUrl } from 'util/url';
import { useHistory } from 'react-router';
import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
const PAGE_VIEW_QUERY = 'view';
const EDIT_PAGE = 'edit';
type SubscriptionArgs = {
channelName: string,
uri: string,
notificationsDisabled?: boolean,
};
type Props = {
uri: string,
claim: ?Claim,
repostedClaim: ?Claim,
contentClaim: ?Claim,
contentSigningChannel: ?Claim,
contentChannelUri: string,
openModal: (id: string, {}) => void,
inline?: boolean,
claimIsMine: boolean,
channelIsMuted: boolean,
channelIsBlocked: boolean,
doToggleMuteChannel: (string) => void,
channelIsAdminBlocked: boolean,
isAdmin: boolean,
doChannelMute: (string) => void,
doChannelUnmute: (string) => void,
doCommentModBlock: (string) => void,
doCommentModUnBlock: (string) => void,
doCommentModBlockAsAdmin: (string, string) => void,
doCommentModUnBlockAsAdmin: (string, string) => void,
doCollectionEdit: (string, any) => void,
hasClaimInWatchLater: boolean,
hasClaimInFavorites: boolean,
claimInCollection: boolean,
collectionId: string,
isMyCollection: boolean,
doToast: ({ message: string, isError?: boolean }) => void,
claimIsMine: boolean,
fileInfo: FileListItem,
prepareEdit: ({}, string, {}) => void,
isSubscribed: boolean,
doChannelSubscribe: (SubscriptionArgs) => void,
doChannelUnsubscribe: (SubscriptionArgs) => void,
isChannelPage: boolean,
editedCollection: Collection,
isAuthenticated: boolean,
};
function ClaimMenuList(props: Props) {
const {
uri,
claim,
repostedClaim,
contentClaim,
contentSigningChannel,
contentChannelUri,
openModal,
inline = false,
claimIsMine,
doToggleMuteChannel,
doChannelMute,
doChannelUnmute,
channelIsMuted,
channelIsBlocked,
channelIsAdminBlocked,
isAdmin,
doCommentModBlock,
doCommentModUnBlock,
doCommentModBlockAsAdmin,
doCommentModUnBlockAsAdmin,
doCollectionEdit,
hasClaimInWatchLater,
hasClaimInFavorites,
collectionId,
isMyCollection,
doToast,
claimIsMine,
fileInfo,
prepareEdit,
isSubscribed,
doChannelSubscribe,
doChannelUnsubscribe,
isChannelPage = false,
editedCollection,
isAuthenticated,
} = props;
const channelUri =
claim &&
(claim.value_type === 'channel'
? claim.permanent_url
: claim.signing_channel && claim.signing_channel.permanent_url);
const incognitoClaim = contentChannelUri && !contentChannelUri.includes('@');
const isChannel = !incognitoClaim && !contentSigningChannel;
const { channelName } = parseURI(contentChannelUri);
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
const subscriptionLabel = repostedClaim
? isSubscribed
? __('Unfollow @%channelName%', { channelName })
: __('Follow @%channelName%', { channelName })
: isSubscribed
? __('Unfollow')
: __('Follow');
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, uri);
if (!channelUri || !claim) {
const { push, replace } = useHistory();
if (!claim) {
return null;
}
const lbryUrl: string = generateLbryContentUrl(claim.canonical_url, claim.permanent_url);
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, lbryUrl);
const rssUrl: string = isChannel ? generateRssUrl(SHARE_DOMAIN, claim) : '';
const isCollectionClaim = claim && claim.value_type === 'collection';
// $FlowFixMe
const isPlayable =
contentClaim &&
// $FlowFixMe
contentClaim.value &&
// $FlowFixMe
contentClaim.value.stream_type &&
// $FlowFixMe
(contentClaim.value.stream_type === 'audio' || contentClaim.value.stream_type === 'video');
function handleAdd(source, name, collectionId) {
doToast({
message: source ? __('Item removed from %name%', { name }) : __('Item added to %name%', { name }),
});
doCollectionEdit(collectionId, {
claims: [contentClaim],
remove: source,
type: 'playlist',
});
}
function handleFollow() {
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
subscriptionHandler({
channelName: '@' + channelName,
uri: contentChannelUri,
notificationsDisabled: true,
});
}
function handleToggleMute() {
doToggleMuteChannel(channelUri);
if (channelIsMuted) {
doChannelUnmute(contentChannelUri);
} else {
doChannelMute(contentChannelUri);
}
}
function handleToggleBlock() {
if (channelIsBlocked) {
doCommentModUnBlock(channelUri);
doCommentModUnBlock(contentChannelUri);
} else {
doCommentModBlock(channelUri);
doCommentModBlock(contentChannelUri);
}
}
function handleEdit() {
if (!isChannel) {
const signingChannelName = contentSigningChannel && contentSigningChannel.name;
const uriObject: { streamName: string, streamClaimId: string, channelName?: string } = {
streamName: claim.name,
streamClaimId: claim.claim_id,
};
if (signingChannelName) {
uriObject.channelName = signingChannelName;
}
const editUri = buildURI(uriObject);
push(`/$/${PAGES.UPLOAD}`);
prepareEdit(claim, editUri, fileInfo);
} else {
const channelUrl = claim.name + ':' + claim.claim_id;
push(`/${channelUrl}?${PAGE_VIEW_QUERY}=${EDIT_PAGE}`);
}
}
function handleDelete() {
if (!repostedClaim && !isChannel) {
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri, doGoBack: false });
} else {
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: isChannel && (() => replace(`/$/${PAGES.CHANNELS}`)) });
}
}
function handleSupport() {
openModal(MODALS.SEND_TIP, { uri, isSupport: true });
}
function handleToggleAdminBlock() {
if (channelIsAdminBlocked) {
doCommentModUnBlockAsAdmin(contentChannelUri, '');
} else {
doCommentModBlockAsAdmin(contentChannelUri, '');
}
}
function copyToClipboard(textToCopy, successMsg, failureMsg) {
navigator.clipboard
.writeText(textToCopy)
.then(() => {
doToast({ message: __(successMsg) });
})
.catch(() => {
doToast({ message: __(failureMsg), isError: true });
});
}
function handleCopyRssLink() {
copyToClipboard(rssUrl, 'RSS URL copied.', 'Failed to copy RSS URL.');
}
function handleCopyLink() {
navigator.clipboard.writeText(shareUrl);
copyToClipboard(shareUrl, 'Link copied.', 'Failed to copy link.');
}
function handleReportContent() {
window.open(`https://lbry.com/dmca/${claim.claim_id}`, '_blank', 'noopener');
// $FlowFixMe
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`);
}
return (
@@ -77,34 +239,179 @@ function ClaimMenuList(props: Props) {
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
</MenuButton>
<MenuList className="menu__list">
{!claimIsMine && (
{(!IS_WEB || (IS_WEB && isAuthenticated)) && (
<>
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.BLOCK} />
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
</div>
</MenuItem>
<>
{/* COLLECTION OPERATIONS */}
{collectionId && isCollectionClaim ? (
<>
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.VIEW} />
{__('View List')}
</div>
</MenuItem>
{isMyCollection && (
<>
<MenuItem
className="comment__menu-option"
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
>
<div className="menu__link">
<Icon aria-hidden iconColor={'red'} icon={ICONS.PUBLISH} />
{editedCollection ? __('Publish') : __('Edit List')}
</div>
</MenuItem>
<MenuItem
className="comment__menu-option"
onSelect={() => openModal(MODALS.COLLECTION_DELETE, { collectionId })}
>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.DELETE} />
{__('Delete List')}
</div>
</MenuItem>
</>
)}
</>
) : (
isPlayable && (
<>
{/* WATCH LATER */}
<MenuItem
className="comment__menu-option"
onSelect={() =>
handleAdd(hasClaimInWatchLater, __('Watch Later'), COLLECTIONS_CONSTS.WATCH_LATER_ID)
}
>
<div className="menu__link">
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
</div>
</MenuItem>
{/* FAVORITES LIST */}
<MenuItem
className="comment__menu-option"
onSelect={() => handleAdd(hasClaimInFavorites, __('Favorites'), COLLECTIONS_CONSTS.FAVORITES_ID)}
>
<div className="menu__link">
<Icon aria-hidden icon={hasClaimInFavorites ? ICONS.DELETE : ICONS.STAR} />
{hasClaimInFavorites ? __('In Favorites') : __('Favorites')}
</div>
</MenuItem>
{/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */}
<MenuItem
className="comment__menu-option"
onSelect={() => openModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })}
>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.STACK} />
{__('Add to Lists')}
</div>
</MenuItem>
<hr className="menu__separator" />
</>
)
)}
</>
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.MUTE} />
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
</div>
</MenuItem>
{!isChannelPage && (
<>
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.LBC} />
{__('Support --[button to support a claim]--')}
</div>
</MenuItem>
</>
)}
<hr className="menu__separator" />
{!incognitoClaim && !claimIsMine && !isChannelPage && (
<>
<hr className="menu__separator" />
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
{subscriptionLabel}
</div>
</MenuItem>
</>
)}
{!isMyCollection && (
<>
{(!claimIsMine || channelIsBlocked) && contentChannelUri ? (
!incognitoClaim && (
<>
<hr className="menu__separator" />
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.BLOCK} />
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
</div>
</MenuItem>
{isAdmin && (
<MenuItem className="comment__menu-option" onSelect={handleToggleAdminBlock}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.GLOBE} />
{channelIsAdminBlocked ? __('Global Unblock Channel') : __('Global Block Channel')}
</div>
</MenuItem>
)}
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.MUTE} />
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
</div>
</MenuItem>
</>
)
) : (
<>
{!isChannelPage && !repostedClaim && (
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.EDIT} />
{__('Edit')}
</div>
</MenuItem>
)}
</>
)}
{showDelete && (
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.DELETE} />
{__('Delete')}
</div>
</MenuItem>
)}
</>
)}
</>
)}
<hr className="menu__separator" />
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.SHARE} />
<Icon aria-hidden icon={ICONS.COPY_LINK} />
{__('Copy Link')}
</div>
</MenuItem>
{!claimIsMine && (
{isChannelPage && IS_WEB && rssUrl && (
<MenuItem className="comment__menu-option" onSelect={handleCopyRssLink}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.RSS} />
{__('Copy RSS URL')}
</div>
</MenuItem>
)}
{!claimIsMine && !isMyCollection && (
<MenuItem className="comment__menu-option" onSelect={handleReportContent}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.REPORT} />
@@ -14,6 +14,7 @@ function ClaimPreviewLoading(props: Props) {
className={classnames('claim-preview__wrapper', {
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
'claim-preview__wrapper--inline': type === 'inline',
'claim-preview__wrapper--small': type === 'small',
})}
>
<div className={classnames('claim-preview', { 'claim-preview--large': type === 'large' })}>
+44 -21
View File
@@ -10,6 +10,13 @@ import {
makeSelectReflectingClaimForUri,
makeSelectClaimWasPurchased,
makeSelectStreamingUrlForUri,
makeSelectClaimIsStreamPlaceholder,
makeSelectCollectionIsMine,
doCollectionEdit,
makeSelectUrlsForCollectionId,
makeSelectIndexForUrlInCollection,
makeSelectTitleForUri,
makeSelectDateForUri,
} from 'lbry-redux';
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
@@ -17,32 +24,48 @@ import { selectShowMatureContent } from 'redux/selectors/settings';
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
import { selectModerationBlockList } from 'redux/selectors/comments';
import ClaimPreview from './view';
const select = (state, props) => ({
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
obscureNsfw: selectShowMatureContent(state) === false,
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
repostClaim: props.uri && makeSelectClaimForUri(props.uri)(state),
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
mutedUris: selectMutedChannels(state),
blockedUris: selectModerationBlockList(state),
hasVisitedUri: props.uri && makeSelectHasVisitedUri(props.uri)(state),
channelIsBlocked: props.uri && makeSelectChannelIsMuted(props.uri)(state),
isSubscribed: props.uri && makeSelectIsSubscribed(props.uri, true)(state),
streamingUrl: props.uri && makeSelectStreamingUrlForUri(props.uri)(state),
wasPurchased: props.uri && makeSelectClaimWasPurchased(props.uri)(state),
});
import ClaimPreview from './view';
import formatMediaDuration from 'util/formatMediaDuration';
const select = (state, props) => {
const claim = props.uri && makeSelectClaimForUri(props.uri)(state);
const media = claim && claim.value && (claim.value.video || claim.value.audio);
const mediaDuration = media && media.duration && formatMediaDuration(media.duration, { screenReader: true });
return {
claim,
mediaDuration,
date: props.uri && makeSelectDateForUri(props.uri)(state),
title: props.uri && makeSelectTitleForUri(props.uri)(state),
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
obscureNsfw: selectShowMatureContent(state) === false,
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
repostClaim: props.uri && makeSelectClaimForUri(props.uri)(state),
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
mutedUris: selectMutedChannels(state),
blockedUris: selectModerationBlockList(state),
hasVisitedUri: props.uri && makeSelectHasVisitedUri(props.uri)(state),
channelIsBlocked: props.uri && makeSelectChannelIsMuted(props.uri)(state),
isSubscribed: props.uri && makeSelectIsSubscribed(props.uri, true)(state),
streamingUrl: props.uri && makeSelectStreamingUrlForUri(props.uri)(state),
wasPurchased: props.uri && makeSelectClaimWasPurchased(props.uri)(state),
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
isCollectionMine: makeSelectCollectionIsMine(props.collectionId)(state),
collectionUris: makeSelectUrlsForCollectionId(props.collectionId)(state),
collectionIndex: makeSelectIndexForUrlInCollection(props.uri, props.collectionId)(state),
};
};
const perform = (dispatch) => ({
resolveUri: (uri) => dispatch(doResolveUri(uri)),
getFile: (uri) => dispatch(doFileGet(uri, false)),
editCollection: (id, params) => dispatch(doCollectionEdit(id, params)),
});
export default connect(select, perform)(ClaimPreview);
+265 -117
View File
@@ -2,13 +2,15 @@
import type { Node } from 'react';
import React, { useEffect, forwardRef } from 'react';
import { NavLink, withRouter } from 'react-router-dom';
import classnames from 'classnames';
import { parseURI } from 'lbry-redux';
import { formatLbryUrlForWeb } from 'util/url';
import { isEmpty } from 'util/object';
import { lazyImport } from 'util/lazyImport';
import classnames from 'classnames';
import { parseURI, COLLECTIONS_CONSTS, isURIEqual } from 'lbry-redux';
import { formatLbryUrlForWeb } from 'util/url';
import { formatClaimPreviewTitle } from 'util/formatAriaLabel';
import FileThumbnail from 'component/fileThumbnail';
import UriIndicator from 'component/uriIndicator';
import FileProperties from 'component/fileProperties';
import PreviewOverlayProperties from 'component/previewOverlayProperties';
import ClaimTags from 'component/claimTags';
import SubscribeButton from 'component/subscribeButton';
import ChannelThumbnail from 'component/channelThumbnail';
@@ -18,16 +20,25 @@ import ClaimPreviewTitle from 'component/claimPreviewTitle';
import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle';
import ClaimRepostAuthor from 'component/claimRepostAuthor';
import FileDownloadLink from 'component/fileDownloadLink';
import AbandonedChannelPreview from 'component/abandonedChannelPreview';
import FileWatchLaterLink from 'component/fileWatchLaterLink';
import PublishPending from 'component/publishPending';
import ClaimMenuList from 'component/claimMenuList';
import ClaimPreviewLoading from './claim-preview-loading';
import ClaimPreviewHidden from './claim-preview-no-mature';
import ClaimPreviewNoContent from './claim-preview-no-content';
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
import { CONTAINER_ID } from 'constants/navigation';
const AbandonedChannelPreview = lazyImport(() =>
import('component/abandonedChannelPreview' /* webpackChunkName: "abandonedChannelPreview" */)
);
type Props = {
uri: string,
claim: ?Claim,
active: boolean,
obscureNsfw: boolean,
showUserBlocked: boolean,
claimIsMine: boolean,
@@ -35,7 +46,7 @@ type Props = {
reflectingProgress?: any, // fxme
resolveUri: (string) => void,
isResolvingUri: boolean,
history: { push: (string) => void },
history: { push: (string | any) => void },
title: string,
nsfw: boolean,
placeholder: string,
@@ -55,7 +66,7 @@ type Props = {
actions: boolean | Node | string | number,
properties: boolean | Node | string | number | ((Claim) => Node),
empty?: Node,
onClick?: (any) => any,
onClick?: (e: any, index?: number) => any,
streamingUrl: ?string,
getFile: (string) => void,
customShouldHide?: (Claim) => boolean,
@@ -68,6 +79,18 @@ type Props = {
hideRepostLabel?: boolean,
repostUrl?: string,
hideMenu?: boolean,
isLivestream?: boolean,
live?: boolean,
collectionId?: string,
editCollection: (string, CollectionEditParams) => void,
isCollectionMine: boolean,
collectionUris: Array<Collection>,
collectionIndex?: number,
disableNavigation?: boolean,
mediaDuration?: string,
date?: any,
containerId?: string, // ID or name of the container (e.g. ClaimList, HOC, etc.) that this is in.
indexInContainer?: number, // The index order of this component within 'containerId'.
};
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
@@ -82,8 +105,11 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
// claim properties
// is the claim consider nsfw?
nsfw,
date,
title,
claimIsMine,
streamingUrl,
mediaDuration,
// user properties
channelIsBlocked,
hasVisitedUri,
@@ -97,6 +123,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
pending,
empty,
// modifiers
active,
customShouldHide,
showNullPlaceholder,
// value from show mature content user setting
@@ -117,13 +144,28 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
renderActions,
hideMenu = false,
// repostUrl,
isLivestream, // need both? CHECK
live,
collectionId,
collectionIndex,
editCollection,
isCollectionMine,
collectionUris,
disableNavigation,
containerId,
indexInContainer,
} = props;
const isCollection = claim && claim.value_type === 'collection';
const collectionClaimId = isCollection && claim && claim.claim_id;
const listId = collectionId || collectionClaimId;
const WrapperElement = wrapperElement || 'li';
const shouldFetch =
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
const abandoned = !isResolvingUri && !claim;
const shouldHideActions = hideActions || type === 'small' || type === 'tooltip';
const isMyCollection = listId && (isCollectionMine || listId.includes('-'));
const shouldHideActions = hideActions || isMyCollection || type === 'small' || type === 'tooltip';
const canonicalUrl = claim && claim.canonical_url;
const lastCollectionIndex = collectionUris ? collectionUris.length - 1 : 0;
let isValid = false;
if (uri) {
try {
@@ -133,15 +175,53 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
isValid = false;
}
}
const isRepost = claim && claim.repost_url;
const contentUri = claim && isRepost ? claim.canonical_url || claim.permanent_url : uri;
const isChannelUri = isValid ? parseURI(contentUri).isChannel : false;
// $FlowFixMe
const isPlayable =
claim &&
// $FlowFixMe
claim.value &&
// $FlowFixMe
claim.value.stream_type &&
// $FlowFixMe
(claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
const isChannelUri = isValid ? parseURI(uri).isChannel : false;
const signingChannel = claim && claim.signing_channel;
const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
// Get channel title ( use name as fallback )
let channelTitle = null;
if (signingChannel) {
const { value, name } = signingChannel;
if (value && value.title) {
channelTitle = value.title;
} else {
channelTitle = name;
}
}
// Aria-label value for claim preview
let ariaLabelData = isChannelUri ? title : formatClaimPreviewTitle(title, channelTitle, date, mediaDuration);
let navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
let navigateSearch = new URLSearchParams();
if (listId) {
navigateSearch.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
}
const handleNavLinkClick = (e) => {
if (onClick) {
onClick(e, indexInContainer);
}
e.stopPropagation();
};
const navLinkProps = {
to: navigateUrl,
onClick: (e) => e.stopPropagation(),
to: {
pathname: navigateUrl,
search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '',
state: containerId ? { [CONTAINER_ID]: containerId } : undefined,
},
onClick: (e) => handleNavLinkClick(e),
onAuxClick: (e) => handleNavLinkClick(e),
};
// do not block abandoned and nsfw claims if showUserBlocked is passed
@@ -169,10 +249,10 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
}
// block stream claims
if (claim && !shouldHide && !showUserBlocked && mutedUris.length && signingChannel) {
shouldHide = mutedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
shouldHide = mutedUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
}
if (claim && !shouldHide && !showUserBlocked && blockedUris.length && signingChannel) {
shouldHide = blockedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
shouldHide = blockedUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
}
if (!shouldHide && customShouldHide && claim) {
@@ -183,15 +263,19 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
// Weird placement warning
// Make sure this happens after we figure out if this claim needs to be hidden
const thumbnailUrl = useGetThumbnail(contentUri, claim, streamingUrl, getFile, shouldHide);
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
function handleOnClick(e) {
if (onClick) {
onClick(e);
onClick(e, indexInContainer);
}
if (claim && !pending) {
history.push(navigateUrl);
if (claim && !pending && !disableNavigation) {
history.push({
pathname: navigateUrl,
search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '',
state: containerId ? { [CONTAINER_ID]: containerId } : undefined,
});
}
}
@@ -201,7 +285,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
}
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
if (shouldHide && !showNullPlaceholder) {
if ((shouldHide && !showNullPlaceholder) || (isLivestream && !ENABLE_NO_SOURCE_CLAIMS)) {
return null;
}
@@ -227,13 +311,22 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
return empty || <ClaimPreviewNoContent isChannel={isChannelUri} type={type} />;
}
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
return <AbandonedChannelPreview uri={contentUri} type />;
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && isChannelUri && claim === null) {
return (
<React.Suspense fallback={null}>
<AbandonedChannelPreview uri={uri} type />
</React.Suspense>
);
}
if (placeholder === 'publish' && !claim && contentUri.startsWith('lbry://@')) {
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
return null;
}
let liveProperty = null;
if (live === true) {
liveProperty = (claim) => <>LIVE</>;
}
return (
<WrapperElement
ref={ref}
@@ -243,108 +336,163 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
'claim-preview__wrapper--channel': isChannelUri && type !== 'inline',
'claim-preview__wrapper--inline': type === 'inline',
'claim-preview__wrapper--small': type === 'small',
'claim-preview__live': live,
'claim-preview__active': active,
})}
>
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
<>
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
<div
className={classnames('claim-preview', {
'claim-preview--small': type === 'small' || type === 'tooltip',
'claim-preview--large': type === 'large',
'claim-preview--inline': type === 'inline',
'claim-preview--tooltip': type === 'tooltip',
'claim-preview--channel': isChannelUri,
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
'claim-preview--pending': pending,
})}
>
{isChannelUri && claim ? (
<UriIndicator uri={contentUri} link>
<ChannelThumbnail uri={contentUri} />
</UriIndicator>
) : (
<>
{!pending ? (
<NavLink {...navLinkProps}>
<FileThumbnail thumbnail={thumbnailUrl}>
{/* @if TARGET='app' */}
{claim && (
<div
className={classnames('claim-preview', {
'claim-preview--small': type === 'small' || type === 'tooltip',
'claim-preview--large': type === 'large',
'claim-preview--inline': type === 'inline',
'claim-preview--tooltip': type === 'tooltip',
'claim-preview--channel': isChannelUri,
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
'claim-preview--pending': pending,
})}
>
{isChannelUri && claim ? (
<UriIndicator focusable={false} uri={uri} link>
<ChannelThumbnail uri={uri} small={type === 'inline'} />
</UriIndicator>
) : (
<>
{!pending ? (
<NavLink aria-hidden tabIndex={-1} {...navLinkProps}>
<FileThumbnail thumbnail={thumbnailUrl}>
<div className="claim-preview__hover-actions">
<FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
{isPlayable && <FileWatchLaterLink focusable={false} uri={uri} />}
</div>
)}
{/* @endif */}
{!isRepost && !isChannelUri && (
<div className="claim-preview__file-property-overlay">
<FileProperties uri={contentUri} small />
<div className="claim-preview__hover-actions">
{/* @if TARGET='app' */}
{claim && !isCollection && (
<FileDownloadLink focusable={false} uri={canonicalUrl} hideOpenButton hideDownloadStatus />
)}
{/* @endif */}
</div>
)}
</FileThumbnail>
</NavLink>
) : (
<FileThumbnail thumbnail={thumbnailUrl} />
)}
</>
)}
<div className="claim-preview__text">
<div className="claim-preview-metadata">
<div className="claim-preview-info">
{pending ? (
<ClaimPreviewTitle uri={contentUri} />
) : (
<NavLink {...navLinkProps}>
<ClaimPreviewTitle uri={uri} />
{!isLivestream && (
<div className="claim-preview__file-property-overlay">
<PreviewOverlayProperties uri={uri} small={type === 'small'} properties={liveProperty} />
</div>
)}
</FileThumbnail>
</NavLink>
) : (
<FileThumbnail thumbnail={thumbnailUrl} />
)}
{/* {type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
<ChannelThumbnail uri={signingChannel.permanent_url} />
)} */}
</div>
<ClaimPreviewSubtitle uri={uri} type={type} />
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
</div>
{type !== 'small' && (
<div className="claim-preview__actions">
{!pending && (
<>
{renderActions && claim && renderActions(claim)}
{shouldHideActions || renderActions ? null : actions !== undefined ? (
actions
) : (
<div className="claim-preview__primary-actions">
{!isChannelUri && signingChannel && (
<div className="claim-preview__channel-staked">
<ChannelThumbnail uri={signingChannel.permanent_url} />
</div>
)}
{isChannelUri && !channelIsBlocked && !claimIsMine && (
<SubscribeButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
)}
{includeSupportAction && <ClaimSupportButton uri={uri} />}
</div>
)}
</>
)}
{claim && (
<React.Fragment>
{typeof properties === 'function' ? (
properties(claim)
) : properties !== undefined ? (
properties
) : (
<ClaimTags uri={uri} type={type} />
)}
</React.Fragment>
)}
</div>
</>
)}
<div className="claim-preview__text">
<div className="claim-preview-metadata">
<div className="claim-preview-info">
{pending ? (
<ClaimPreviewTitle uri={uri} />
) : (
<NavLink aria-label={ariaLabelData} aria-current={active ? 'page' : null} {...navLinkProps}>
<ClaimPreviewTitle uri={uri} />
</NavLink>
)}
</div>
<ClaimPreviewSubtitle uri={uri} type={type} />
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
</div>
{type !== 'small' && (
<div className="claim-preview__actions">
{!pending && (
<>
{renderActions && claim && renderActions(claim)}
{Boolean(isMyCollection && listId) && (
<>
<div className="collection-preview__edit-buttons">
<div className="collection-preview__edit-group">
<Button
button="alt"
className={'button-collection-order'}
disabled={collectionIndex === 0}
icon={ICONS.UP}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
});
}
}}
/>
<Button
button="alt"
className={'button-collection-order'}
icon={ICONS.DOWN}
disabled={collectionIndex === lastCollectionIndex}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex + 1) },
});
}
}}
/>
</div>
<div className="collection-preview__edit-group">
<Button
button="alt"
icon={ICONS.DELETE}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
// $FlowFixMe
if (editCollection) editCollection(listId, { claims: [claim], remove: true });
}}
/>
</div>
</div>
</>
)}
{shouldHideActions || renderActions ? null : actions !== undefined ? (
actions
) : (
<div className="claim-preview__primary-actions">
{!isChannelUri && signingChannel && (
<div className="claim-preview__channel-staked">
<ChannelThumbnail uri={signingChannel.permanent_url} xsmall />
</div>
)}
{isChannelUri && !channelIsBlocked && !claimIsMine && (
<SubscribeButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
)}
{includeSupportAction && <ClaimSupportButton uri={uri} />}
</div>
)}
</>
)}
{claim && (
<React.Fragment>
{typeof properties === 'function' ? (
properties(claim)
) : properties !== undefined ? (
properties
) : (
<ClaimTags uri={uri} type={type} />
)}
</React.Fragment>
)}
</div>
)}
</div>
</div>
</div>
{!hideMenu && <ClaimMenuList uri={uri} />}
{!hideMenu && <ClaimMenuList uri={uri} collectionId={listId} />}
</>
</WrapperElement>
);
});
+10 -3
View File
@@ -1,16 +1,23 @@
import * as PAGES from 'constants/pages';
import { connect } from 'react-redux';
import { makeSelectClaimForUri, makeSelectClaimIsPending, doClearPublish, doPrepareEdit } from 'lbry-redux';
import {
makeSelectClaimForUri,
makeSelectClaimIsPending,
doClearPublish,
doPrepareEdit,
makeSelectClaimIsStreamPlaceholder,
} from 'lbry-redux';
import { push } from 'connected-react-router';
import ClaimPreviewSubtitle from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
pending: makeSelectClaimIsPending(props.uri)(state),
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
});
const perform = dispatch => ({
beginPublish: name => {
const perform = (dispatch) => ({
beginPublish: (name) => {
dispatch(doClearPublish());
dispatch(doPrepareEdit({ name }));
dispatch(push(`/$/${PAGES.UPLOAD}`));
+13 -8
View File
@@ -1,4 +1,5 @@
// @flow
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
import React from 'react';
import UriIndicator from 'component/uriIndicator';
import DateTime from 'component/dateTime';
@@ -11,10 +12,11 @@ type Props = {
pending?: boolean,
type: string,
beginPublish: (string) => void,
isLivestream: boolean,
};
function ClaimPreviewSubtitle(props: Props) {
const { pending, uri, claim, type, beginPublish } = props;
const { pending, uri, claim, type, beginPublish, isLivestream } = props;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
let isChannel;
@@ -28,13 +30,16 @@ function ClaimPreviewSubtitle(props: Props) {
{claim ? (
<React.Fragment>
<UriIndicator uri={uri} link />{' '}
{!pending &&
claim &&
(isChannel ? (
type !== 'inline' && `${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`
) : (
<DateTime timeAgo uri={uri} />
))}
{!pending && claim && (
<>
{isChannel &&
type !== 'inline' &&
`${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`}
{!isChannel &&
(isLivestream && ENABLE_NO_SOURCE_CLAIMS ? __('Livestream') : <DateTime timeAgo uri={uri} />)}
</>
)}
</React.Fragment>
) : (
<React.Fragment>
+24 -12
View File
@@ -8,24 +8,36 @@ import {
doFileGet,
makeSelectChannelForClaimUri,
makeSelectClaimIsNsfw,
makeSelectClaimIsStreamPlaceholder,
makeSelectDateForUri,
} from 'lbry-redux';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
import { selectShowMatureContent } from 'redux/selectors/settings';
import ClaimPreviewTile from './view';
import formatMediaDuration from 'util/formatMediaDuration';
const select = (state, props) => ({
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),
title: props.uri && makeSelectTitleForUri(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(props.uri)(state),
});
const select = (state, props) => {
const claim = props.uri && makeSelectClaimForUri(props.uri)(state);
const media = claim && claim.value && (claim.value.video || claim.value.audio);
const mediaDuration = media && media.duration && formatMediaDuration(media.duration, { screenReader: true });
return {
claim,
mediaDuration,
date: props.uri && makeSelectDateForUri(props.uri)(state),
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),
title: props.uri && makeSelectTitleForUri(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(props.uri)(state),
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
};
};
const perform = (dispatch) => ({
resolveUri: (uri) => dispatch(doResolveUri(uri)),
+96 -36
View File
@@ -10,15 +10,22 @@ import ChannelThumbnail from 'component/channelThumbnail';
import SubscribeButton from 'component/subscribeButton';
import useGetThumbnail from 'effects/use-get-thumbnail';
import { formatLbryUrlForWeb } from 'util/url';
import { parseURI } from 'lbry-redux';
import FileProperties from 'component/fileProperties';
import { formatClaimPreviewTitle } from 'util/formatAriaLabel';
import { parseURI, COLLECTIONS_CONSTS, isURIEqual } from 'lbry-redux';
import PreviewOverlayProperties from 'component/previewOverlayProperties';
import FileDownloadLink from 'component/fileDownloadLink';
import FileWatchLaterLink from 'component/fileWatchLaterLink';
import ClaimRepostAuthor from 'component/claimRepostAuthor';
import ClaimMenuList from 'component/claimMenuList';
import CollectionPreviewOverlay from 'component/collectionPreviewOverlay';
// $FlowFixMe cannot resolve ...
import PlaceholderTx from 'static/img/placeholderTx.gif';
type Props = {
uri: string,
date?: any,
claim: ?Claim,
mediaDuration?: string,
resolveUri: (string) => void,
isResolvingUri: boolean,
history: { push: (string) => void },
@@ -35,17 +42,22 @@ type Props = {
}>,
blockedChannelUris: Array<string>,
getFile: (string) => void,
placeholder: boolean,
streamingUrl: string,
isMature: boolean,
showMature: boolean,
showHiddenByUser?: boolean,
properties?: (Claim) => void,
live?: boolean,
collectionId?: string,
showNoSourceClaims?: boolean,
isLivestream: boolean,
};
function ClaimPreviewTile(props: Props) {
const {
history,
uri,
date,
isResolvingUri,
thumbnail,
title,
@@ -60,34 +72,58 @@ function ClaimPreviewTile(props: Props) {
isMature,
showMature,
showHiddenByUser,
properties,
live,
showNoSourceClaims,
isLivestream,
collectionId,
mediaDuration,
} = props;
const isRepost = claim && claim.repost_channel_url;
const isCollection = claim && claim.value_type === 'collection';
const isStream = claim && claim.value_type === 'stream';
// $FlowFixMe
const isPlayable =
claim &&
// $FlowFixMe
claim.value &&
// $FlowFixMe
claim.value.stream_type &&
// $FlowFixMe
(claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
const collectionClaimId = isCollection && claim && claim.claim_id;
const shouldFetch = claim === undefined;
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
const canonicalUrl = claim && claim.canonical_url;
const navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
let navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
const listId = collectionId || collectionClaimId;
if (listId) {
const collectionParams = new URLSearchParams();
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
navigateUrl = navigateUrl + `?` + collectionParams.toString();
}
const navLinkProps = {
to: navigateUrl,
onClick: (e) => e.stopPropagation(),
};
let isChannel;
let isValid = false;
if (uri) {
try {
({ isChannel } = parseURI(uri));
parseURI(uri);
isValid = true;
} catch (e) {
isValid = false;
}
}
let channelUri;
const signingChannel = claim && claim.signing_channel;
if (signingChannel) {
channelUri = signingChannel.permanent_url;
}
const isChannel = claim && claim.value_type === 'channel';
const channelUri = !isChannel ? signingChannel && signingChannel.permanent_url : claim && claim.permanent_url;
const channelTitle = signingChannel && ((signingChannel.value && signingChannel.value.title) || signingChannel.name);
// Aria-label value for claim preview
let ariaLabelData = isChannel ? title : formatClaimPreviewTitle(title, channelTitle, date, mediaDuration);
function handleClick(e) {
if (navigateUrl) {
@@ -129,22 +165,24 @@ function ClaimPreviewTile(props: Props) {
// block stream claims
if (claim && !shouldHide && !showHiddenByUser && blockedChannelUris.length && signingChannel) {
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
shouldHide = blockedChannelUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
}
// block channel claims if we can't control for them in claim search
// e.g. fetchRecommendedSubscriptions
if (claim && isChannel && !shouldHide && !showHiddenByUser && blockedChannelUris.length) {
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
if (claim && isChannel && !shouldHide && !showHiddenByUser && blockedChannelUris.length && signingChannel) {
shouldHide = blockedChannelUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
}
if (shouldHide) {
if (shouldHide || (isLivestream && !showNoSourceClaims)) {
return null;
}
if (placeholder || isResolvingUri) {
if (placeholder || (!claim && isResolvingUri)) {
return (
<li className={classnames('claim-preview--tile', {})}>
<div className="placeholder media__thumb" />
<div className="placeholder media__thumb">
<img src={PlaceholderTx} alt="Placeholder" />
</div>
<div className="placeholder__wrapper">
<div className="placeholder claim-tile__title" />
<div className="placeholder claim-tile__info" />
@@ -153,41 +191,63 @@ function ClaimPreviewTile(props: Props) {
);
}
let liveProperty = null;
if (live === true) {
liveProperty = (claim) => <>LIVE</>;
}
return (
<li
role="link"
onClick={handleClick}
className={classnames('card claim-preview--tile', {
'claim-preview__wrapper--channel': isChannel,
'claim-preview__live': live,
})}
>
<NavLink {...navLinkProps}>
<NavLink {...navLinkProps} role="none" tabIndex={-1} aria-hidden>
<FileThumbnail thumbnail={thumbnailUrl} allowGifs>
{!isChannel && (
<React.Fragment>
{/* @if TARGET='app' */}
<div className="claim-preview__hover-actions">
<FileDownloadLink uri={canonicalUrl} hideOpenButton />
{isPlayable && (
<FileWatchLaterLink focusable={false} uri={uri} />
)}
</div>
{/* @endif */}
<div className="claim-preview__hover-actions">
{/* @if TARGET='app' */}
{isStream && (
<FileDownloadLink focusable={false} uri={canonicalUrl} hideOpenButton />
)}
{/* @endif */}
</div>
<div className="claim-preview__file-property-overlay">
<FileProperties uri={uri} small />
<PreviewOverlayProperties uri={uri} properties={liveProperty || properties} />
</div>
</React.Fragment>
)}
{isCollection && (
<React.Fragment>
<div className="claim-preview__collection-wrapper">
<CollectionPreviewOverlay collectionId={listId} uri={uri} />
</div>
</React.Fragment>
)}
</FileThumbnail>
</NavLink>
<NavLink {...navLinkProps}>
<h2 className="claim-tile__title">
<TruncatedText text={title || (claim && claim.name)} lines={isChannel ? 1 : 2} />
{isChannel && (
<div className="claim-tile__about">
<UriIndicator uri={uri} link />
</div>
)}
<ClaimMenuList uri={uri} />
</h2>
</NavLink>
<div className="claim-tile__header">
<NavLink aria-label={ariaLabelData} {...navLinkProps}>
<h2 className="claim-tile__title">
<TruncatedText text={title || (claim && claim.name)} lines={isChannel ? 1 : 2} />
{isChannel && (
<div className="claim-tile__about">
<UriIndicator uri={uri} />
</div>
)}
</h2>
</NavLink>
<ClaimMenuList uri={uri} collectionId={listId} channelUri={channelUri} />
</div>
<div>
<div className="claim-tile__info">
{isChannel ? (
@@ -196,8 +256,8 @@ function ClaimPreviewTile(props: Props) {
</div>
) : (
<React.Fragment>
<UriIndicator uri={uri} link hideAnonymous>
<ChannelThumbnail uri={channelUri} />
<UriIndicator focusable={false} uri={uri} link hideAnonymous>
<ChannelThumbnail uri={channelUri} xsmall />
</UriIndicator>
<div className="claim-tile__about">
@@ -1,12 +1,12 @@
import { connect } from 'react-redux';
import { makeSelectFilePartlyDownloaded, makeSelectClaimIsMine } from 'lbry-redux';
import { makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
import FileProperties from './view';
import ClaimProperties from './view';
const select = (state, props) => ({
downloaded: makeSelectFilePartlyDownloaded(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
isSubscribed: makeSelectIsSubscribed(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
});
export default connect(select, null)(FileProperties);
export default connect(select, null)(ClaimProperties);
+38
View File
@@ -0,0 +1,38 @@
// @flow
import * as ICONS from 'constants/icons';
import * as React from 'react';
import classnames from 'classnames';
import Icon from 'component/common/icon';
import FilePrice from 'component/filePrice';
import ClaimType from 'component/claimType';
import * as COL from 'constants/collections';
type Props = {
uri: string,
isSubscribed: boolean,
small: boolean,
claim: Claim | CollectionClaim,
iconOnly: boolean,
};
export default function ClaimProperties(props: Props) {
const { uri, isSubscribed, small = false, claim, iconOnly } = props;
const isCollection = claim && claim.value_type === 'collection';
const size = small ? COL.ICON_SIZE : undefined;
// $FlowFixMe
return (
<div
className={classnames('claim-preview__overlay-properties', { 'claim-preview__overlay-properties--small': small })}
>
{
<>
<ClaimType uri={uri} small />
{/* // $FlowFixMe */}
{isCollection && claim && claim.value.claims && !iconOnly && <div>{claim.value.claims.length}</div>}
{isSubscribed && <Icon size={size} tooltip icon={ICONS.SUBSCRIBE} />}
<FilePrice hideFree uri={uri} />
</>
}
</div>
);
}
+1 -1
View File
@@ -52,7 +52,7 @@ export default function ClaimTags(props: Props) {
}
return (
<div className={classnames('file-properties--small', { 'file-properties--large': type === 'large' })}>
<div className={classnames('claim__tags', { 'claim__tags--large': type === 'large' })}>
{tagsToDisplay.map((tag) => (
<Tag key={tag} title={tag} name={tag} />
))}
+14 -3
View File
@@ -1,14 +1,25 @@
import { connect } from 'react-redux';
import { doClaimSearch, selectClaimSearchByQuery, selectFetchingClaimSearchByQuery, SETTINGS } from 'lbry-redux';
import {
doClaimSearch,
selectClaimSearchByQuery,
selectFetchingClaimSearchByQuery,
SETTINGS,
selectClaimsByUri,
} from 'lbry-redux';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
import { selectModerationBlockList } from 'redux/selectors/comments';
import { selectMutedChannels } from 'redux/selectors/blocked';
import ClaimListDiscover from './view';
const select = (state) => ({
claimSearchByQuery: selectClaimSearchByQuery(state),
claimsByUri: selectClaimsByUri(state),
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
showNsfw: selectShowMatureContent(state),
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
mutedUris: selectMutedChannels(state),
blockedUris: selectModerationBlockList(state),
});
const perform = {
+202 -18
View File
@@ -1,8 +1,88 @@
// @flow
import { ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
import * as CS from 'constants/claim_search';
import type { Node } from 'react';
import React from 'react';
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
import { createNormalizedClaimSearchKey, MATURE_TAGS, splitBySeparator } from 'lbry-redux';
import ClaimPreviewTile from 'component/claimPreviewTile';
import { useHistory } from 'react-router';
import { getLivestreamOnlyOptions } from 'util/search';
/**
* Updates 'uris' by adding and/or moving active livestreams to the front of
* list.
* 'liveUris' is also updated with any entries that were moved to the
* front, for convenience.
*
* @param uris [Ref]
* @param liveUris [Ref]
* @param livestreamMap
* @param claimsByUri
* @param claimSearchByQuery
* @param options
*/
export function prioritizeActiveLivestreams(
uris: Array<string>,
liveUris: Array<string>,
livestreamMap: { [string]: any },
claimsByUri: { [string]: any },
claimSearchByQuery: { [string]: Array<string> },
options: any
) {
if (!livestreamMap || !uris) return;
const claimIsLive = (claim, liveChannelIds) => {
// This function relies on:
// 1. Only 1 actual livestream per channel (i.e. all other livestream-claims
// for that channel actually point to the same source).
// 2. 'liveChannelIds' needs to be pruned after being accounted for,
// otherwise all livestream-claims will be "live" (we'll only take the
// latest one as "live" ).
return (
claim &&
claim.value_type === 'stream' &&
claim.value.source === undefined &&
claim.signing_channel &&
liveChannelIds.includes(claim.signing_channel.claim_id)
);
};
let liveChannelIds = Object.keys(livestreamMap);
// 1. Collect active livestreams from the primary search to put in front.
uris.forEach((uri) => {
const claim = claimsByUri[uri];
if (claimIsLive(claim, liveChannelIds)) {
liveUris.push(uri);
// This live channel has been accounted for, so remove it.
liveChannelIds.splice(liveChannelIds.indexOf(claim.signing_channel.claim_id), 1);
}
});
// 2. Now, repeat on the secondary search.
if (options) {
const livestreamsOnlySearchCacheQuery = createNormalizedClaimSearchKey(getLivestreamOnlyOptions(options));
const livestreamsOnlyUris = claimSearchByQuery[livestreamsOnlySearchCacheQuery];
if (livestreamsOnlyUris) {
livestreamsOnlyUris.forEach((uri) => {
const claim = claimsByUri[uri];
if (!uris.includes(uri) && claimIsLive(claim, liveChannelIds)) {
liveUris.push(uri);
// This live channel has been accounted for, so remove it.
liveChannelIds.splice(liveChannelIds.indexOf(claim.signing_channel.claim_id), 1);
}
});
}
}
// 3. Finalize uris by putting live livestreams in front.
const newUris = liveUris.concat(uris.filter((uri) => !liveUris.includes(uri)));
uris.splice(0, uris.length, ...newUris);
}
// ****************************************************************************
// ClaimTilesDiscover
// ****************************************************************************
type Props = {
prefixUris?: Array<string>,
@@ -11,12 +91,9 @@ type Props = {
showNsfw: boolean,
hideReposts: boolean,
history: { action: string, push: (string) => void, replace: (string) => void },
claimSearchByQuery: {
[string]: Array<string>,
},
fetchingClaimSearchByQuery: {
[string]: boolean,
},
claimSearchByQuery: { [string]: Array<string> },
fetchingClaimSearchByQuery: { [string]: boolean },
claimsByUri: { [string]: any },
// claim search options are below
tags: Array<string>,
blockedUris: Array<string>,
@@ -27,16 +104,25 @@ type Props = {
orderBy?: Array<string>,
releaseTime?: string,
languages?: Array<string>,
claimType?: Array<string>,
claimType?: string | Array<string>,
streamTypes?: Array<string>,
timestamp?: string,
feeAmount?: string,
limitClaimsPerChannel?: number,
hasSource?: boolean,
hasNoSource?: boolean,
renderProperties?: (Claim) => ?Node,
liveLivestreamsFirst?: boolean,
livestreamMap?: { [string]: any },
pinUrls?: Array<string>,
showNoSourceClaims?: boolean,
};
function ClaimTilesDiscover(props: Props) {
const {
doClaimSearch,
claimSearchByQuery,
claimsByUri,
showNsfw,
hideReposts,
// Below are options to pass that are forwarded to claim_search
@@ -48,16 +134,40 @@ function ClaimTilesDiscover(props: Props) {
releaseTime,
languages,
claimType,
prefixUris,
streamTypes,
timestamp,
feeAmount,
limitClaimsPerChannel,
fetchingClaimSearchByQuery,
hasSource,
hasNoSource,
renderProperties,
blockedUris,
mutedUris,
liveLivestreamsFirst,
livestreamMap,
pinUrls,
prefixUris,
showNoSourceClaims,
} = props;
const { location } = useHistory();
const urlParams = new URLSearchParams(location.search);
const feeAmountInUrl = urlParams.get('fee_amount');
const feeAmountParam = feeAmountInUrl || feeAmount;
const mutedAndBlockedChannelIds = Array.from(
new Set(mutedUris.concat(blockedUris).map((uri) => splitBySeparator(uri)[1]))
);
const liveUris = [];
let streamTypesParam;
if (streamTypes) {
streamTypesParam = streamTypes;
} else if (SIMPLE_SITE && !hasNoSource && streamTypes !== null) {
streamTypesParam = [CS.FILE_VIDEO, CS.FILE_AUDIO];
}
const [prevUris, setPrevUris] = React.useState([]);
const options: {
page_size: number,
no_totals: boolean,
@@ -69,11 +179,13 @@ function ClaimTilesDiscover(props: Props) {
order_by: Array<string>,
languages?: Array<string>,
release_time?: string,
claim_type?: Array<string>,
claim_type?: string | Array<string>,
timestamp?: string,
fee_amount?: string,
limit_claims_per_channel?: number,
stream_types?: Array<string>,
has_source?: boolean,
has_no_source?: boolean,
} = {
page_size: pageSize,
claim_type: claimType || undefined,
@@ -84,10 +196,17 @@ function ClaimTilesDiscover(props: Props) {
not_tags: !showNsfw ? MATURE_TAGS : [],
any_languages: languages,
channel_ids: channelIds || [],
not_channel_ids: [],
not_channel_ids: mutedAndBlockedChannelIds,
order_by: orderBy || ['trending_group', 'trending_mixed'],
stream_types: streamTypesParam,
};
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
options.has_no_source = true;
} else if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream'))) {
options.has_source = true;
}
if (releaseTime) {
options.release_time = releaseTime;
}
@@ -121,25 +240,90 @@ function ClaimTilesDiscover(props: Props) {
options.claim_ids = claimIds;
}
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
const uris = (prefixUris || []).concat(claimSearchByQuery[claimSearchCacheQuery] || []);
const mainSearchKey = createNormalizedClaimSearchKey(options);
const livestreamSearchKey = liveLivestreamsFirst
? createNormalizedClaimSearchKey(getLivestreamOnlyOptions(options))
: undefined;
let uris = (prefixUris || []).concat(claimSearchByQuery[mainSearchKey] || []);
const isLoading = fetchingClaimSearchByQuery[mainSearchKey];
if (liveLivestreamsFirst && livestreamMap && !isLoading) {
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, options);
}
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
const optionsStringForEffect = JSON.stringify(options);
const isLoading = fetchingClaimSearchByQuery[claimSearchCacheQuery];
const shouldPerformSearch = !isLoading && uris.length === 0;
if (
prefixUris === undefined &&
(claimSearchByQuery[mainSearchKey] === undefined ||
(livestreamSearchKey && claimSearchByQuery[livestreamSearchKey] === undefined))
) {
// This is a new query and we don't have results yet ...
if (prevUris.length !== 0) {
// ... but we have previous results. Use it until new results are here.
uris = prevUris;
}
}
React.useEffect(() => {
if (shouldPerformSearch) {
const searchOptions = JSON.parse(optionsStringForEffect);
doClaimSearch(searchOptions);
if (liveLivestreamsFirst) {
doClaimSearch(getLivestreamOnlyOptions(searchOptions));
}
}
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect]);
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, liveLivestreamsFirst]);
React.useEffect(() => {
if (JSON.stringify(prevUris) !== JSON.stringify(uris) && !shouldPerformSearch) {
setPrevUris(uris);
}
}, [shouldPerformSearch, prevUris, uris]);
const resolveLive = (index) => {
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
return true;
}
return undefined;
};
const modifiedUris = uris ? uris.slice() : [];
const fixUris = pinUrls || [];
if (pinUrls && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
fixUris.forEach((fixUri) => {
if (modifiedUris.indexOf(fixUri) !== -1) {
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
} else {
modifiedUris.pop();
}
});
modifiedUris.splice(2, 0, ...fixUris);
}
return (
<ul className="claim-grid">
{uris && uris.length
? uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} />)
: new Array(pageSize).fill(1).map((x, i) => <ClaimPreviewTile key={i} placeholder />)}
{modifiedUris && modifiedUris.length
? modifiedUris.map((uri, index) => (
<ClaimPreviewTile
showNoSourceClaims={hasNoSource || showNoSourceClaims}
key={uri}
uri={uri}
properties={renderProperties}
live={resolveLive(index)}
/>
))
: new Array(pageSize)
.fill(1)
.map((x, i) => (
<ClaimPreviewTile showNoSourceClaims={hasNoSource || showNoSourceClaims} key={i} placeholder />
))}
</ul>
);
}
+10
View File
@@ -0,0 +1,10 @@
import { connect } from 'react-redux';
import { makeSelectClaimForUri, makeSelectClaimIsStreamPlaceholder } from 'lbry-redux';
import FileType from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
});
export default connect(select)(FileType);
+29
View File
@@ -0,0 +1,29 @@
// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import Icon from 'component/common/icon';
import * as COL from 'constants/collections';
type Props = {
claim: Claim,
small: boolean,
};
function ClaimType(props: Props) {
const { claim, small } = props;
const { value_type: claimType } = claim || {};
const size = small ? COL.ICON_SIZE : undefined;
if (claimType === 'collection') {
return <Icon size={size} icon={ICONS.STACK} />;
} else if (claimType === 'channel') {
return <Icon size={size} icon={ICONS.CHANNEL} />;
} else if (claimType === 'repost') {
return <Icon size={size} icon={ICONS.REPOST} />;
}
return <Icon icon={ICONS.DOWNLOADABLE} />;
}
export default ClaimType;
+30
View File
@@ -0,0 +1,30 @@
import { connect } from 'react-redux';
import {
makeSelectClaimIsMine,
makeSelectClaimForUri,
selectMyChannelClaims,
makeSelectClaimIsPending,
makeSelectCollectionIsMine,
makeSelectEditedCollectionForId,
} from 'lbry-redux';
import { makeSelectCostInfoForUri } from 'lbryinc';
import { doToast } from 'redux/actions/notifications';
import { doOpenModal } from 'redux/actions/app';
import CollectionActions from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
costInfo: makeSelectCostInfoForUri(props.uri)(state),
myChannels: selectMyChannelClaims(state),
claimIsPending: makeSelectClaimIsPending(props.uri)(state),
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
collectionHasEdits: Boolean(makeSelectEditedCollectionForId(props.collectionId)(state)),
});
const perform = (dispatch) => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
doToast: (options) => dispatch(doToast(options)),
});
export default connect(select, perform)(CollectionActions);
+130
View File
@@ -0,0 +1,130 @@
// @flow
import * as PAGES from 'constants/pages';
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
import { useIsMobile } from 'effects/use-screensize';
import ClaimSupportButton from 'component/claimSupportButton';
import FileReactions from 'component/fileReactions';
import { useHistory } from 'react-router';
import { EDIT_PAGE, PAGE_VIEW_QUERY } from 'page/collection/view';
import classnames from 'classnames';
import { ENABLE_FILE_REACTIONS } from 'config';
type Props = {
uri: string,
claim: StreamClaim,
openModal: (id: string, { uri: string, claimIsMine?: boolean, isSupport?: boolean }) => void,
myChannels: ?Array<ChannelClaim>,
doToast: ({ message: string }) => void,
claimIsPending: boolean,
isMyCollection: boolean,
collectionId: string,
showInfo: boolean,
setShowInfo: (boolean) => void,
collectionHasEdits: boolean,
};
function CollectionActions(props: Props) {
const {
uri,
openModal,
claim,
claimIsPending,
isMyCollection,
collectionId,
showInfo,
setShowInfo,
collectionHasEdits,
} = props;
const { push } = useHistory();
const isMobile = useIsMobile();
const claimId = claim && claim.claim_id;
const webShareable = true; // collections have cost?
const lhsSection = (
<>
{ENABLE_FILE_REACTIONS && uri && <FileReactions uri={uri} />}
{uri && <ClaimSupportButton uri={uri} fileAction />}
{/* TODO Add ClaimRepostButton component */}
{uri && (
<Button
className="button--file-action"
icon={ICONS.SHARE}
label={__('Share')}
title={__('Share')}
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
/>
)}
</>
);
const rhsSection = (
<>
{isMyCollection && (
<Button
title={uri ? __('Update') : __('Publish')}
label={uri ? __('Update') : __('Publish')}
className={classnames('button--file-action')}
onClick={() => push(`?${PAGE_VIEW_QUERY}=${EDIT_PAGE}`)}
icon={ICONS.PUBLISH}
iconColor={collectionHasEdits && 'red'}
iconSize={18}
disabled={claimIsPending}
/>
)}
{isMyCollection && (
<Button
className={classnames('button--file-action')}
title={__('Delete List')}
onClick={() => openModal(MODALS.COLLECTION_DELETE, { uri, collectionId, redirect: `/$/${PAGES.LISTS}` })}
icon={ICONS.DELETE}
iconSize={18}
description={__('Delete List')}
disabled={claimIsPending}
/>
)}
{!isMyCollection && (
<Button
title={__('Report content')}
className="button--file-action"
icon={ICONS.REPORT}
navigate={`/$/${PAGES.REPORT_CONTENT}?claimId=${claimId}`}
/>
)}
</>
);
const infoButton = (
<Button
title={__('Info')}
className={classnames('button-toggle', {
'button-toggle--active': showInfo,
})}
icon={ICONS.MORE}
onClick={() => setShowInfo(!showInfo)}
/>
);
if (isMobile) {
return (
<div className="media__actions">
{lhsSection}
{rhsSection}
{uri && <span>{infoButton}</span>}
</div>
);
} else {
return (
<div className="media__subtitle--between">
<div className="section__actions">
{lhsSection}
{rhsSection}
</div>
{uri && <>{infoButton}</>}
</div>
);
}
}
export default CollectionActions;
@@ -0,0 +1,29 @@
import { connect } from 'react-redux';
import CollectionContent from './view';
import {
makeSelectUrlsForCollectionId,
makeSelectNameForCollectionId,
makeSelectCollectionForId,
makeSelectClaimForUri,
makeSelectClaimIsMine,
} from 'lbry-redux';
import {
selectPlayingUri,
} from 'redux/selectors/content';
const select = (state, props) => {
const playingUri = selectPlayingUri(state);
const playingUrl = playingUri && playingUri.uri;
const claim = makeSelectClaimForUri(playingUrl)(state);
const url = claim && claim.permanent_url;
return {
url,
collection: makeSelectCollectionForId(props.id)(state),
collectionUrls: makeSelectUrlsForCollectionId(props.id)(state),
collectionName: makeSelectNameForCollectionId(props.id)(state),
isMine: makeSelectClaimIsMine(url)(state),
};
};
export default connect(select)(CollectionContent);
@@ -0,0 +1,54 @@
// @flow
import React from 'react';
import ClaimList from 'component/claimList';
import Card from 'component/common/card';
import Button from 'component/button';
import * as PAGES from 'constants/pages';
import Icon from 'component/common/icon';
import * as ICONS from 'constants/icons';
import { COLLECTIONS_CONSTS } from 'lbry-redux';
type Props = {
id: string,
url: string,
isMine: boolean,
collectionUrls: Array<Claim>,
collectionName: string,
collection: any,
createUnpublishedCollection: (string, Array<any>, ?string) => void,
};
export default function CollectionContent(props: Props) {
const { collectionUrls, collectionName, id, url } = props;
return (
<Card
isBodyList
className="file-page__recommended"
title={
<span>
<Icon
icon={(id === COLLECTIONS_CONSTS.WATCH_LATER_ID && ICONS.TIME) ||
(id === COLLECTIONS_CONSTS.FAVORITES_ID && ICONS.STAR) || ICONS.STACK}
className="icon--margin-right" />
{collectionName}
</span>
}
titleActions={
<div className="card__title-actions--link">
{/* TODO: BUTTON TO SAVE COLLECTION - Probably save/copy modal */}
<Button label={'View List'} button="link" navigate={`/$/${PAGES.LIST}/${id}`} />
</div>
}
body={
<ClaimList
isCardBody
type="small"
activeUri={url}
uris={collectionUrls}
collectionId={id}
empty={__('List is Empty')}
/>
}
/>
);
}
+53
View File
@@ -0,0 +1,53 @@
import { connect } from 'react-redux';
import {
makeSelectTitleForUri,
makeSelectThumbnailForUri,
makeSelectMetadataItemForUri,
doCollectionPublish,
doCollectionPublishUpdate,
makeSelectAmountForUri,
makeSelectClaimForUri,
selectUpdateCollectionError,
selectUpdatingCollection,
selectCreateCollectionError,
selectBalance,
selectCreatingCollection,
makeSelectCollectionForId,
makeSelectUrlsForCollectionId,
makeSelectClaimIdsForCollectionId,
ACTIONS as LBRY_REDUX_ACTIONS,
} from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
import CollectionForm from './view';
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state),
thumbnailUrl: makeSelectThumbnailForUri(props.uri)(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
tags: makeSelectMetadataItemForUri(props.uri, 'tags')(state),
locations: makeSelectMetadataItemForUri(props.uri, 'locations')(state),
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
amount: makeSelectAmountForUri(props.uri)(state),
updateError: selectUpdateCollectionError(state),
updatingCollection: selectUpdatingCollection(state),
createError: selectCreateCollectionError(state),
creatingCollection: selectCreatingCollection(state),
balance: selectBalance(state),
activeChannelClaim: selectActiveChannelClaim(state),
incognito: selectIncognito(state),
collection: makeSelectCollectionForId(props.collectionId)(state),
collectionUrls: makeSelectUrlsForCollectionId(props.collectionId)(state),
collectionClaimIds: makeSelectClaimIdsForCollectionId(props.collectionId)(state),
});
const perform = (dispatch) => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
publishCollectionUpdate: (params) => dispatch(doCollectionPublishUpdate(params)),
publishCollection: (params, collectionId) => dispatch(doCollectionPublish(params, collectionId)),
clearCollectionErrors: () => dispatch({ type: LBRY_REDUX_ACTIONS.CLEAR_COLLECTION_ERRORS }),
});
export default connect(select, perform)(CollectionForm);
+440
View File
@@ -0,0 +1,440 @@
// @flow
import { DOMAIN } from 'config';
import React from 'react';
import classnames from 'classnames';
import Button from 'component/button';
import TagsSearch from 'component/tagsSearch';
import ErrorText from 'component/common/error-text';
import ClaimAbandonButton from 'component/claimAbandonButton';
import ChannelSelector from 'component/channelSelector';
import ClaimList from 'component/claimList';
import Card from 'component/common/card';
import LbcSymbol from 'component/common/lbc-symbol';
import ThumbnailPicker from 'component/thumbnailPicker';
import { useHistory } from 'react-router-dom';
import { isNameValid, regexInvalidURI } from 'lbry-redux';
import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'component/common/tabs';
import { FormField } from 'component/common/form';
import { handleBidChange } from 'util/publish';
import { FF_MAX_CHARS_IN_DESCRIPTION } from 'constants/form-field';
import { INVALID_NAME_ERROR } from 'constants/claim';
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
import * as PAGES from 'constants/pages';
import analytics from 'analytics';
const LANG_NONE = 'none';
const MAX_TAG_SELECT = 5;
type Props = {
uri: string,
claim: CollectionClaim,
balance: number,
disabled: boolean,
activeChannelClaim: ?ChannelClaim,
incognito: boolean,
// params
title: string,
amount: number,
thumbnailUrl: string,
description: string,
tags: Array<string>,
locations: Array<string>,
languages: Array<string>,
collectionId: string,
collection: Collection,
collectionClaimIds: Array<string>,
collectionUrls: Array<string>,
publishCollectionUpdate: (CollectionUpdateParams) => Promise<any>,
updatingCollection: boolean,
updateError: string,
publishCollection: (CollectionPublishParams, string) => Promise<any>,
createError: string,
creatingCollection: boolean,
clearCollectionErrors: () => void,
onDone: (string) => void,
openModal: (
id: string,
{ onUpdate: (string) => void, assetName: string, helpText: string, currentValue: string, title: string }
) => void,
};
function CollectionForm(props: Props) {
const {
uri, // collection uri
claim,
balance,
// publish params
amount,
title,
description,
thumbnailUrl,
tags,
locations,
languages = [],
// rest
onDone,
publishCollectionUpdate,
updateError,
updatingCollection,
publishCollection,
creatingCollection,
createError,
disabled,
activeChannelClaim,
incognito,
collectionId,
collection,
collectionUrls,
collectionClaimIds,
clearCollectionErrors,
} = props;
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://';
if (activeChannelName && !incognito) {
prefix += `${activeChannelName}/`;
}
const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id;
const collectionName = (claim && claim.name) || (collection && collection.name);
const [nameError, setNameError] = React.useState(undefined);
const [bidError, setBidError] = React.useState('');
const [params, setParams]: [any, (any) => void] = React.useState(getCollectionParams());
const name = params.name;
const isNewCollection = !uri;
const { replace } = useHistory();
const languageParam = params.languages;
const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0];
const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1];
const collectionClaimIdsString = JSON.stringify(collectionClaimIds);
function parseName(newName) {
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
return newName.replace(INVALID_URI_CHARS, '-');
}
function setParam(paramObj) {
setParams({ ...params, ...paramObj });
}
function getCollectionParams() {
const collectionParams: {
thumbnail_url?: string,
name?: string,
description?: string,
title?: string,
bid: string,
languages?: ?Array<string>,
locations?: ?Array<string>,
tags?: ?Array<{ name: string }>,
claim_id?: string,
channel_id?: string,
claims: ?Array<string>,
} = {
thumbnail_url: thumbnailUrl,
description,
bid: String(amount || 0.001),
languages: languages || [],
locations: locations || [],
tags: tags
? tags.map((tag) => {
return { name: tag };
})
: [],
claims: collectionClaimIds,
};
collectionParams['name'] = parseName(collectionName);
if (activeChannelId) {
collectionParams['channel_id'] = activeChannelId;
}
if (!claim) {
collectionParams['title'] = collectionName;
}
if (claim) {
collectionParams['claim_id'] = claim.claim_id;
collectionParams['title'] = title;
}
return collectionParams;
}
React.useEffect(() => {
const collectionClaimIds = JSON.parse(collectionClaimIdsString);
setParams({ ...params, claims: collectionClaimIds });
clearCollectionErrors();
}, [collectionClaimIdsString, setParams]);
function handleLanguageChange(index, code) {
let langs = [...languageParam];
if (index === 0) {
if (code === LANG_NONE) {
// clear all
langs = [];
} else {
langs[0] = code;
}
} else {
if (code === LANG_NONE || code === langs[0]) {
langs.splice(1, 1);
} else {
langs[index] = code;
}
}
setParams({ ...params, languages: langs });
}
function handleThumbnailChange(thumbnailUrl: string) {
setParams({ ...params, thumbnail_url: thumbnailUrl });
}
function handleSubmit() {
if (uri) {
publishCollectionUpdate(params).then((pendingClaim) => {
if (pendingClaim) {
const claimId = pendingClaim.claim_id;
analytics.apiLogPublish(pendingClaim);
onDone(claimId);
}
});
} else {
publishCollection(params, collectionId).then((pendingClaim) => {
if (pendingClaim) {
const claimId = pendingClaim.claim_id;
analytics.apiLogPublish(pendingClaim);
onDone(claimId);
}
});
}
}
React.useEffect(() => {
let nameError;
if (!name && name !== undefined) {
nameError = __('A name is required for your url');
} else if (!isNameValid(name, false)) {
nameError = INVALID_NAME_ERROR;
}
setNameError(nameError);
}, [name]);
React.useEffect(() => {
if (incognito) {
const newParams = Object.assign({}, params);
delete newParams.channel_id;
setParams(newParams);
} else if (activeChannelId) {
setParams({ ...params, channel_id: activeChannelId });
}
}, [activeChannelId, incognito, setParams]);
const itemError = !params.claims.length ? __('Cannot publish empty list') : '';
const submitError = nameError || bidError || itemError || updateError || createError;
return (
<>
<div className={classnames('main--contained', { 'card--disabled': disabled })}>
<Tabs>
<TabList className="tabs__list--collection-edit-page">
<Tab>{__('General')}</Tab>
<Tab>{__('Items')}</Tab>
<Tab>{__('Credits')}</Tab>
<Tab>{__('Tags')}</Tab>
<Tab>{__('Other')}</Tab>
</TabList>
<TabPanels>
<TabPanel>
<div className={'card-stack'}>
<ChannelSelector disabled={disabled} />
<Card
body={
<>
<fieldset-group className="fieldset-group--smushed fieldset-group--disabled-prefix">
<fieldset-section>
<label htmlFor="channel_name">{__('Channel')}</label>
</fieldset-section>
</fieldset-group>
<fieldset-group class="fieldset-group--smushed fieldset-group--disabled-prefix">
<fieldset-section>
<label htmlFor="channel_name">{__('Name')}</label>
<div className="form-field__prefix">{prefix}</div>
</fieldset-section>
<FormField
autoFocus={isNewCollection}
type="text"
name="channel_name"
placeholder={__('MyAwesomeList')}
value={params.name}
error={nameError}
disabled={!isNewCollection}
onChange={(e) => setParams({ ...params, name: e.target.value || '' })}
/>
</fieldset-group>
{!isNewCollection && (
<span className="form-field__help">{__('This field cannot be changed.')}</span>
)}
<FormField
type="text"
name="channel_title2"
label={__('Title')}
placeholder={__('My Awesome List')}
value={params.title}
onChange={(e) => setParams({ ...params, title: e.target.value })}
/>
<ThumbnailPicker
inline
thumbnailParam={params.thumbnail_url}
updateThumbnailParam={handleThumbnailChange}
/>
<FormField
type="markdown"
name="content_description2"
label={__('Description')}
placeholder={__('Description of your content')}
value={params.description}
onChange={(text) => setParams({ ...params, description: text })}
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
/>
</>
}
/>
</div>
</TabPanel>
<TabPanel>
<ClaimList uris={collectionUrls} collectionId={collectionId} empty={__('This list has no items.')} />
</TabPanel>
<TabPanel>
<Card
body={
<FormField
className="form-field--price-amount"
type="number"
name="content_bid2"
step="any"
label={<LbcSymbol postfix={__('Deposit')} size={14} />}
value={params.bid}
error={bidError}
min="0.0"
disabled={false}
onChange={(event) =>
handleBidChange(parseFloat(event.target.value), amount, balance, setBidError, setParam)
}
placeholder={0.1}
helper={__('Increasing your deposit can help your channel be discovered more easily.')}
/>
}
/>
</TabPanel>
<TabPanel>
<Card
body={
<TagsSearch
suggestMature
disableAutoFocus
limitSelect={MAX_TAG_SELECT}
tagsPassedIn={params.tags || []}
label={__('Selected Tags')}
onRemove={(clickedTag) => {
const newTags = params.tags.slice().filter((tag) => tag.name !== clickedTag.name);
setParams({ ...params, tags: newTags });
}}
onSelect={(newTags) => {
newTags.forEach((newTag) => {
if (!params.tags.map((savedTag) => savedTag.name).includes(newTag.name)) {
setParams({ ...params, tags: [...params.tags, newTag] });
} else {
// If it already exists and the user types it in, remove it
setParams({ ...params, tags: params.tags.filter((tag) => tag.name !== newTag.name) });
}
});
}}
/>
}
/>
</TabPanel>
<TabPanel>
<Card
body={
<>
<FormField
name="language_select"
type="select"
label={__('Primary Language')}
onChange={(event) => handleLanguageChange(0, event.target.value)}
value={primaryLanguage}
helper={__('Your main content language')}
>
<option key={'pri-langNone'} value={LANG_NONE}>
{__('None selected')}
</option>
{Object.keys(SUPPORTED_LANGUAGES).map((language) => (
<option key={language} value={language}>
{SUPPORTED_LANGUAGES[language]}
</option>
))}
</FormField>
<FormField
name="language_select2"
type="select"
label={__('Secondary Language')}
onChange={(event) => handleLanguageChange(1, event.target.value)}
value={secondaryLanguage}
disabled={!languageParam[0]}
helper={__('Your other content language')}
>
<option key={'sec-langNone'} value={LANG_NONE}>
{__('None selected')}
</option>
{Object.keys(SUPPORTED_LANGUAGES)
.filter((lang) => lang !== languageParam[0])
.map((language) => (
<option key={language} value={language}>
{SUPPORTED_LANGUAGES[language]}
</option>
))}
</FormField>
</>
}
/>
</TabPanel>
</TabPanels>
</Tabs>
<Card
className="card--after-tabs"
actions={
<>
<div className="section__actions">
<Button
button="primary"
disabled={creatingCollection || updatingCollection || nameError || bidError || !params.claims.length}
label={creatingCollection || updatingCollection ? __('Submitting') : __('Submit')}
onClick={handleSubmit}
/>
<Button button="link" label={__('Cancel')} onClick={() => onDone(collectionId)} />
</div>
{submitError ? (
<ErrorText>{submitError}</ErrorText>
) : (
<p className="help">
{__('After submitting, it will take a few minutes for your changes to be live for everyone.')}
</p>
)}
{!isNewCollection && (
<div className="section__actions">
<ClaimAbandonButton uri={uri} abandonActionCallback={() => replace(`/$/${PAGES.LIBRARY}`)} />
</div>
)}
</>
}
/>
</div>
</>
);
}
export default CollectionForm;
+16
View File
@@ -0,0 +1,16 @@
import { connect } from 'react-redux';
import { doCollectionEdit, makeSelectNameForCollectionId, doCollectionDelete } from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
import CollectionMenuList from './view';
const select = (state, props) => {
return {
collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
};
};
export default connect(select, {
doCollectionEdit,
doOpenModal,
doCollectionDelete,
})(CollectionMenuList);
+68
View File
@@ -0,0 +1,68 @@
// @flow
import * as ICONS from 'constants/icons';
import * as MODALS from 'constants/modal_types';
import React from 'react';
import classnames from 'classnames';
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
import Icon from 'component/common/icon';
import * as PAGES from 'constants/pages';
import { useHistory } from 'react-router';
type Props = {
inline?: boolean,
doOpenModal: (string, {}) => void,
collectionName?: string,
collectionId: string,
};
function CollectionMenuList(props: Props) {
const { inline = false, collectionId, collectionName, doOpenModal } = props;
const { push } = useHistory();
return (
<Menu>
<MenuButton
className={classnames('menu__button', { 'claim__menu-button': !inline, 'claim__menu-button--inline': inline })}
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
}}
>
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
</MenuButton>
<MenuList className="menu__list">
{collectionId && collectionName && (
<>
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.VIEW} />
{__('View List')}
</div>
</MenuItem>
<MenuItem
className="comment__menu-option"
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.PUBLISH} />
{__('Publish List')}
</div>
</MenuItem>
<MenuItem
className="comment__menu-option"
onSelect={() => doOpenModal(MODALS.COLLECTION_DELETE, { collectionId })}
>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.DELETE} />
{__('Delete List')}
</div>
</MenuItem>
</>
)}
</MenuList>
</Menu>
);
}
export default CollectionMenuList;
@@ -0,0 +1,30 @@
import { connect } from 'react-redux';
import {
makeSelectIsUriResolving,
makeSelectClaimIdForUri,
makeSelectClaimForClaimId,
makeSelectUrlsForCollectionId,
makeSelectNameForCollectionId,
makeSelectPendingCollectionForId,
makeSelectCountForCollectionId,
} from 'lbry-redux';
import CollectionPreviewOverlay from './view';
const select = (state, props) => {
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
return {
collectionId,
uri: collectionUri,
collectionCount: makeSelectCountForCollectionId(collectionId)(state),
collectionName: makeSelectNameForCollectionId(collectionId)(state),
collectionItemUrls: makeSelectUrlsForCollectionId(collectionId)(state), // ForId || ForUri
pendingCollection: makeSelectPendingCollectionForId(collectionId)(state),
claim,
isResolvingUri: collectionUri && makeSelectIsUriResolving(collectionUri)(state),
};
};
export default connect(select)(CollectionPreviewOverlay);
@@ -0,0 +1,42 @@
// @flow
import React from 'react';
import { withRouter } from 'react-router-dom';
import FileThumbnail from 'component/fileThumbnail';
type Props = {
uri: string,
collectionId: string,
collectionName: string,
collectionCount: number,
editedCollection?: Collection,
pendingCollection?: Collection,
claim: ?Claim,
collectionItemUrls: Array<string>,
};
function CollectionPreviewOverlay(props: Props) {
const { collectionItemUrls } = props;
if (collectionItemUrls && collectionItemUrls.length > 0) {
return (
<div className="collection-preview__overlay-thumbs">
<div className="collection-preview__overlay-side" />
<div className="collection-preview__overlay-grid">
{collectionItemUrls &&
collectionItemUrls.map((item, index) => {
if (index < 2) {
return (
<div className="collection-preview__overlay-grid-items">
<FileThumbnail uri={item} key={item} />
</div>
);
}
})}
</div>
</div>
);
}
return null;
}
export default withRouter(CollectionPreviewOverlay);
@@ -0,0 +1,19 @@
// @flow
import React from 'react';
import classnames from 'classnames';
import * as ICONS from 'constants/icons';
import Icon from 'component/common/icon';
type Props = {
count: number,
};
export default function collectionCount(props: Props) {
const { count = 0 } = props;
return (
<div className={classnames('claim-preview__overlay-properties', 'claim-preview__overlay-properties--small')}>
<Icon icon={ICONS.STACK} />
<div>{count}</div>
</div>
);
}
@@ -0,0 +1,14 @@
// @flow
import React from 'react';
import classnames from 'classnames';
import * as ICONS from 'constants/icons';
import Icon from 'component/common/icon';
export default function collectionCount() {
return (
<div className={classnames('claim-preview__overlay-properties', 'claim-preview__overlay-properties--small')}>
<Icon icon={ICONS.LOCK} />
<div>{__('Private')}</div>
</div>
);
}
@@ -0,0 +1,58 @@
import { connect } from 'react-redux';
import {
doResolveUri,
makeSelectIsUriResolving,
makeSelectThumbnailForUri,
makeSelectTitleForUri,
makeSelectChannelForClaimUri,
makeSelectClaimIsNsfw,
makeSelectClaimIdForUri,
makeSelectClaimForClaimId,
makeSelectUrlsForCollectionId,
makeSelectNameForCollectionId,
doLocalCollectionDelete,
doFetchItemsInCollection,
makeSelectEditedCollectionForId,
makeSelectPendingCollectionForId,
makeSelectCountForCollectionId,
makeSelectIsResolvingCollectionForId,
} from 'lbry-redux';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
import { selectShowMatureContent } from 'redux/selectors/settings';
import CollectionPreviewTile from './view';
const select = (state, props) => {
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
return {
collectionId,
uri: collectionUri,
collectionCount: makeSelectCountForCollectionId(collectionId)(state),
collectionName: makeSelectNameForCollectionId(collectionId)(state),
collectionItemUrls: makeSelectUrlsForCollectionId(collectionId)(state), // ForId || ForUri
editedCollection: makeSelectEditedCollectionForId(collectionId)(state),
pendingCollection: makeSelectPendingCollectionForId(collectionId)(state),
claim,
isResolvingCollectionClaims: makeSelectIsResolvingCollectionForId(collectionId)(state),
channelClaim: collectionUri && makeSelectChannelForClaimUri(collectionUri)(state),
isResolvingUri: collectionUri && makeSelectIsUriResolving(collectionUri)(state),
thumbnail: collectionUri && makeSelectThumbnailForUri(collectionUri)(state),
title: collectionUri && makeSelectTitleForUri(collectionUri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(collectionUri)(state),
};
};
const perform = (dispatch) => ({
resolveUri: (uri) => dispatch(doResolveUri(uri)),
resolveCollectionItems: (options) => doFetchItemsInCollection(options),
deleteCollection: (id) => dispatch(doLocalCollectionDelete(id)),
});
export default connect(select, perform)(CollectionPreviewTile);
+171
View File
@@ -0,0 +1,171 @@
// @flow
import React from 'react';
import classnames from 'classnames';
import { NavLink, useHistory } from 'react-router-dom';
import ClaimPreviewTile from 'component/claimPreviewTile';
import TruncatedText from 'component/common/truncated-text';
import CollectionCount from './collectionCount';
import CollectionPrivate from './collectionPrivate';
import CollectionMenuList from 'component/collectionMenuList';
import { formatLbryUrlForWeb } from 'util/url';
import { COLLECTIONS_CONSTS } from 'lbry-redux';
import FileThumbnail from 'component/fileThumbnail';
type Props = {
uri: string,
collectionId: string,
collectionName: string,
collectionCount: number,
editedCollection?: Collection,
pendingCollection?: Collection,
claim: ?Claim,
channelClaim: ?ChannelClaim,
collectionItemUrls: Array<string>,
resolveUri: (string) => void,
isResolvingUri: boolean,
thumbnail?: string,
title?: string,
placeholder: boolean,
blackListedOutpoints: Array<{
txid: string,
nout: number,
}>,
filteredOutpoints: Array<{
txid: string,
nout: number,
}>,
blockedChannelUris: Array<string>,
isMature?: boolean,
showMature: boolean,
collectionId: string,
deleteCollection: (string) => void,
resolveCollectionItems: (any) => void,
isResolvingCollectionClaims: boolean,
};
function CollectionPreviewTile(props: Props) {
const {
uri,
collectionId,
collectionName,
collectionCount,
isResolvingUri,
isResolvingCollectionClaims,
collectionItemUrls,
claim,
resolveCollectionItems,
} = props;
const { push } = useHistory();
const hasClaim = Boolean(claim);
React.useEffect(() => {
if (collectionId && hasClaim && resolveCollectionItems) {
resolveCollectionItems({ collectionId, page_size: 5 });
}
}, [collectionId, hasClaim]);
// const signingChannel = claim && claim.signing_channel;
let navigateUrl = formatLbryUrlForWeb(collectionItemUrls[0] || '/');
if (collectionId) {
const collectionParams = new URLSearchParams();
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
navigateUrl = navigateUrl + `?` + collectionParams.toString();
}
function handleClick(e) {
if (navigateUrl) {
push(navigateUrl);
}
}
const navLinkProps = {
to: navigateUrl,
onClick: (e) => e.stopPropagation(),
};
/* REMOVE IF WORKS
let shouldHide = false;
if (isMature && !showMature) {
// Unfortunately needed until this is resolved
// https://github.com/lbryio/lbry-sdk/issues/2785
shouldHide = true;
}
// This will be replaced once blocking is done at the wallet server level
if (claim && !shouldHide && blackListedOutpoints) {
shouldHide = blackListedOutpoints.some(
(outpoint) =>
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
);
}
// We're checking to see if the stream outpoint
// or signing channel outpoint is in the filter list
if (claim && !shouldHide && filteredOutpoints) {
shouldHide = filteredOutpoints.some(
(outpoint) =>
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
);
}
// block stream claims
if (claim && !shouldHide && blockedChannelUris.length && signingChannel) {
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
}
// block channel claims if we can't control for them in claim search
// e.g. fetchRecommendedSubscriptions
if (shouldHide) {
return null;
}
*/
if (isResolvingUri || isResolvingCollectionClaims) {
return (
<li className={classnames('claim-preview--tile', {})}>
<div className="placeholder media__thumb" />
<div className="placeholder__wrapper">
<div className="placeholder claim-tile__title" />
<div className="placeholder claim-tile__info" />
</div>
</li>
);
}
if (uri) {
return <ClaimPreviewTile uri={uri} />;
}
return (
<li role="link" onClick={handleClick} className={'card claim-preview--tile'}>
<NavLink {...navLinkProps}>
<FileThumbnail uri={collectionItemUrls && collectionItemUrls.length && collectionItemUrls[0]}>
<React.Fragment>
<div className="claim-preview__claim-property-overlay">
<CollectionCount count={collectionCount} />
</div>
</React.Fragment>
</FileThumbnail>
</NavLink>
<NavLink {...navLinkProps}>
<h2 className="claim-tile__title">
<TruncatedText text={collectionName} lines={1} />
<CollectionMenuList collectionId={collectionId} />
</h2>
</NavLink>
<div>
<div className="claim-tile__info">
<React.Fragment>
<div className="claim-tile__about">
<CollectionPrivate />
</div>
</React.Fragment>
</div>
</div>
</li>
);
}
export default CollectionPreviewTile;
Loaded 100 of 574 files, more files were not shown because too many files have changed in this diff. Show more