Odysee audio support #5897

Merged
tzarebczan merged 1 commit from odysee-audio into master 2021-04-16 04:52:42 +02:00
5 changed files with 13 additions and 6 deletions
Showing only changes of commit 250a1692a0 - Show all commits

View file

@ -1,5 +1,6 @@
// @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 { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
import ClaimPreviewTile from 'component/claimPreviewTile';
@ -29,6 +30,7 @@ type Props = {
releaseTime?: string,
languages?: Array<string>,
claimType?: string | Array<string>,
streamTypes?: Array<string>,
timestamp?: string,
feeAmount?: string,
limitClaimsPerChannel?: number,
@ -49,6 +51,7 @@ function ClaimTilesDiscover(props: Props) {
releaseTime,
languages,
claimType,
streamTypes,
prefixUris,
timestamp,
feeAmount,
@ -89,6 +92,7 @@ function ClaimTilesDiscover(props: Props) {
channel_ids: channelIds || [],
not_channel_ids: [],
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')) {

View file

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

View file

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

View file

@ -12,6 +12,7 @@ type Props = {
filePath: ?string,
isStillEditing: boolean,
uploadThumbnailStatus: string,
thumbnail: string,
waitForFile: boolean,
};
@ -25,6 +26,7 @@ function PublishFormErrors(props: Props) {
filePath,
isStillEditing,
uploadThumbnailStatus,
thumbnail,
waitForFile,
} = props;
// These are extra help
@ -40,6 +42,7 @@ function PublishFormErrors(props: Props) {
{uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS && (
<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 && (
<div>{__('Please reselect a file after changing the LBRY URL')}</div>
)}

View file

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