From 989126c603dcf17ce83078b4eca5c56e68c7b177 Mon Sep 17 00:00:00 2001 From: jessopb <36554050+jessopb@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:06:11 -0400 Subject: [PATCH] Feat publish replays on master (#5863) * provide livestream replay publish via url --- .env.defaults | 1 + config.js | 1 + flow-typed/livestream.js | 22 ++ flow-typed/subscription.js | 11 - static/app-strings.json | 5 + ui/component/common/card.jsx | 2 +- ui/component/fileActions/view.jsx | 17 +- ui/component/livestreamLink/view.jsx | 4 +- ui/component/publishFile/index.js | 11 +- ui/component/publishFile/view.jsx | 328 +++++++++++++++++++++--- ui/component/publishForm/index.js | 53 ++-- ui/component/publishForm/view.jsx | 175 ++++++++++--- ui/component/publishFormErrors/view.jsx | 14 +- ui/constants/livestream.js | 3 +- ui/modal/modalPublishPreview/index.js | 27 +- ui/modal/modalPublishPreview/view.jsx | 15 +- ui/page/livestream/view.jsx | 4 +- ui/page/livestreamSetup/view.jsx | 23 +- ui/redux/actions/publish.js | 3 +- ui/scss/all.scss | 2 +- ui/scss/component/_livestream.scss | 81 ++++++ ui/scss/component/_table.scss | 16 ++ ui/scss/component/section.scss | 4 + web/setup/publish.js | 2 + 24 files changed, 674 insertions(+), 150 deletions(-) create mode 100644 flow-typed/livestream.js diff --git a/.env.defaults b/.env.defaults index 556e4ca44..c7f381eaa 100644 --- a/.env.defaults +++ b/.env.defaults @@ -34,6 +34,7 @@ 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 # OG OG_TITLE_SUFFIX=| lbry.tv diff --git a/config.js b/config.js index 8203652d9..30ef220cc 100644 --- a/config.js +++ b/config.js @@ -39,6 +39,7 @@ const config = { 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, SIMPLE_SITE: process.env.SIMPLE_SITE === 'true', SHOW_ADS: process.env.SHOW_ADS === 'true', PINNED_URI_1: process.env.PINNED_URI_1, diff --git a/flow-typed/livestream.js b/flow-typed/livestream.js new file mode 100644 index 000000000..9b1b2d30a --- /dev/null +++ b/flow-typed/livestream.js @@ -0,0 +1,22 @@ +// @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, + uploadedAt: string, // Date? + }, + id: string, +} +declare type LivestreamReplayData = Array; diff --git a/flow-typed/subscription.js b/flow-typed/subscription.js index 53956b014..6f59206fc 100644 --- a/flow-typed/subscription.js +++ b/flow-typed/subscription.js @@ -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, diff --git a/static/app-strings.json b/static/app-strings.json index 9b59ec2fc..acd6d6084 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1778,5 +1778,10 @@ "Publishing...": "Publishing...", "Collection": "Collection", "More from %claim_name%": "More from %claim_name%", + "Upload that unlabeled video you found behind the TV in 1991": "Upload that unlabeled video 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%", + "Choose Replay": "Choose Replay", "--end--": "--end--" } diff --git a/ui/component/common/card.jsx b/ui/component/common/card.jsx index 2e8e191a8..64ce71d81 100644 --- a/ui/component/common/card.jsx +++ b/ui/component/common/card.jsx @@ -21,7 +21,7 @@ type Props = { nag?: Node, smallTitle?: boolean, onClick?: () => void, - children?: any, // not sure how this works + children?: Node, }; export default function Card(props: Props) { diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index a52970e3e..37acfbc85 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -3,7 +3,6 @@ import { SIMPLE_SITE, SITE_NAME, ENABLE_FILE_REACTIONS } from 'config'; import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; import * as ICONS from 'constants/icons'; -import * as PUBLISH_MODES from 'constants/publish_types'; import React from 'react'; import Button from 'component/button'; import FileDownloadLink from 'component/fileDownloadLink'; @@ -114,25 +113,13 @@ function FileActions(props: Props) {