Odysee audio support (#5897)

This commit is contained in:
Thomas Zarebczan 2021-04-15 22:52:41 -04:00 committed by GitHub
parent 56cf3464ab
commit 9689ef72a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 6 deletions

View file

@ -1,5 +1,6 @@
// @flow // @flow
import { ENABLE_NO_SOURCE_CLAIMS } from 'config'; import { ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
import * as CS from 'constants/claim_search';
import React from 'react'; import React from 'react';
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux'; import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
import ClaimPreviewTile from 'component/claimPreviewTile'; import ClaimPreviewTile from 'component/claimPreviewTile';
@ -29,6 +30,7 @@ type Props = {
releaseTime?: string, releaseTime?: string,
languages?: Array<string>, languages?: Array<string>,
claimType?: string | Array<string>, claimType?: string | Array<string>,
streamTypes?: Array<string>,
timestamp?: string, timestamp?: string,
feeAmount?: string, feeAmount?: string,
limitClaimsPerChannel?: number, limitClaimsPerChannel?: number,
@ -49,6 +51,7 @@ function ClaimTilesDiscover(props: Props) {
releaseTime, releaseTime,
languages, languages,
claimType, claimType,
streamTypes,
prefixUris, prefixUris,
timestamp, timestamp,
feeAmount, feeAmount,
@ -89,6 +92,7 @@ function ClaimTilesDiscover(props: Props) {
channel_ids: channelIds || [], channel_ids: channelIds || [],
not_channel_ids: [], not_channel_ids: [],
order_by: orderBy || ['trending_group', 'trending_mixed'], order_by: orderBy || ['trending_group', 'trending_mixed'],
stream_types: streamTypes || SIMPLE_SITE ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
}; };
if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream')) { if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream')) {

View file

@ -512,13 +512,13 @@ function PublishFile(props: Props) {
{fileSelectSource === SOURCE_UPLOAD && showFileUpload && ( {fileSelectSource === SOURCE_UPLOAD && showFileUpload && (
<> <>
<FileSelector <FileSelector
label={SIMPLE_SITE ? __('Video file') : __('File')} label={SIMPLE_SITE ? __('Video/audio file') : __('File')}
disabled={disabled} disabled={disabled}
currentPath={currentFile} currentPath={currentFile}
onFileChosen={handleFileChange} onFileChosen={handleFileChange}
// https://stackoverflow.com/questions/19107685/safari-input-type-file-accept-video-ignores-mp4-files // https://stackoverflow.com/questions/19107685/safari-input-type-file-accept-video-ignores-mp4-files
accept={SIMPLE_SITE ? 'video/mp4,video/x-m4v,video/*' : undefined} accept={SIMPLE_SITE ? 'video/mp4,video/x-m4v,video/*,audio/*' : undefined}
placeholder={SIMPLE_SITE ? __('Select video file to upload') : __('Select a file to upload')} placeholder={SIMPLE_SITE ? __('Select video or audio file to upload') : __('Select a file to upload')}
/> />
{getUploadMessage()} {getUploadMessage()}
</> </>

View file

@ -2,13 +2,14 @@ import { connect } from 'react-redux';
import { makeSelectPublishFormValue, selectIsStillEditing } from 'lbry-redux'; import { makeSelectPublishFormValue, selectIsStillEditing } from 'lbry-redux';
import PublishPage from './view'; import PublishPage from './view';
const select = state => ({ const select = (state) => ({
bid: makeSelectPublishFormValue('bid')(state), bid: makeSelectPublishFormValue('bid')(state),
name: makeSelectPublishFormValue('name')(state), name: makeSelectPublishFormValue('name')(state),
title: makeSelectPublishFormValue('title')(state), title: makeSelectPublishFormValue('title')(state),
bidError: makeSelectPublishFormValue('bidError')(state), bidError: makeSelectPublishFormValue('bidError')(state),
editingURI: makeSelectPublishFormValue('editingURI')(state), editingURI: makeSelectPublishFormValue('editingURI')(state),
uploadThumbnailStatus: makeSelectPublishFormValue('uploadThumbnailStatus')(state), uploadThumbnailStatus: makeSelectPublishFormValue('uploadThumbnailStatus')(state),
thumbnail: makeSelectPublishFormValue('thumbnail_url')(state),
isStillEditing: selectIsStillEditing(state), isStillEditing: selectIsStillEditing(state),
}); });

View file

@ -12,6 +12,7 @@ type Props = {
filePath: ?string, filePath: ?string,
isStillEditing: boolean, isStillEditing: boolean,
uploadThumbnailStatus: string, uploadThumbnailStatus: string,
thumbnail: string,
waitForFile: boolean, waitForFile: boolean,
}; };
@ -25,6 +26,7 @@ function PublishFormErrors(props: Props) {
filePath, filePath,
isStillEditing, isStillEditing,
uploadThumbnailStatus, uploadThumbnailStatus,
thumbnail,
waitForFile, waitForFile,
} = props; } = props;
// These are extra help // These are extra help
@ -40,6 +42,7 @@ function PublishFormErrors(props: Props) {
{uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS && ( {uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS && (
<div>{__('Please wait for thumbnail to finish uploading')}</div> <div>{__('Please wait for thumbnail to finish uploading')}</div>
)} )}
{!thumbnail && <div>{__('Audio files require a thumbnail. Please upload or provide an image URL above.')}</div>}
{editingURI && !isStillEditing && !filePath && ( {editingURI && !isStillEditing && !filePath && (
<div>{__('Please reselect a file after changing the LBRY URL')}</div> <div>{__('Please reselect a file after changing the LBRY URL')}</div>
)} )}

View file

@ -59,7 +59,6 @@ const SearchOptions = (props: Props) => {
if (simple) { if (simple) {
delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_APPLICATION]; delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_APPLICATION];
delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_IMAGE]; delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_IMAGE];
delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_AUDIO];
} }
React.useEffect(() => { React.useEffect(() => {