Support stream updates via claim_id parameter (#1465)

* Support stream updates via claim_id parameter

* Pass claim_id on v2
This commit is contained in:
saltrafael 2022-05-19 09:13:48 -03:00 committed by GitHub
parent 4c25ae721e
commit 0998e3d48c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View file

@ -9,6 +9,8 @@ WEB_SERVER_PORT=1337
# -- APIs --- # -- APIs ---
LBRY_WEB_API=https://api.na-backend.odysee.com LBRY_WEB_API=https://api.na-backend.odysee.com
LBRY_WEB_PUBLISH_API=https://publish.na-backend.odysee.com/v1
LBRY_WEB_PUBLISH_API_V2=https://publish.na-backend.odysee.com/api/v2/publish/
LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video
COMMENT_SERVER_API=https://comments.odysee.tv/api/v2 COMMENT_SERVER_API=https://comments.odysee.tv/api/v2
SEARCH_SERVER_API_ALT=https://recsys.odysee.tv/search SEARCH_SERVER_API_ALT=https://recsys.odysee.tv/search

View file

@ -57,6 +57,7 @@ declare type TusUploader = any;
declare type FileUploadSdkParams = { declare type FileUploadSdkParams = {
file_path: string | File, file_path: string | File,
claim_id: ?string,
name: ?string, name: ?string,
preview?: boolean, preview?: boolean,
remote_url?: string, remote_url?: string,

View file

@ -97,8 +97,10 @@ function resolvePublishPayload(publishData, myClaimForUri, myChannels, preview)
const channelId = namedChannelClaim ? namedChannelClaim.claim_id : ''; const channelId = namedChannelClaim ? namedChannelClaim.claim_id : '';
const nowTimeStamp = Number(Math.round(Date.now() / 1000)); const nowTimeStamp = Number(Math.round(Date.now() / 1000));
const { claim_id: claimId } = myClaimForUri || {};
const publishPayload: { const publishPayload: {
claim_id?: string,
name: ?string, name: ?string,
bid: string, bid: string,
description?: string, description?: string,
@ -131,6 +133,10 @@ function resolvePublishPayload(publishData, myClaimForUri, myChannels, preview)
preview: false, preview: false,
}; };
if (claimId) {
publishPayload.claim_id = claimId;
}
// Temporary solution to keep the same publish flow with the new tags api // Temporary solution to keep the same publish flow with the new tags api
// Eventually we will allow users to enter their own tags on publish // Eventually we will allow users to enter their own tags on publish
// `nsfw` will probably be removed // `nsfw` will probably be removed

View file

@ -20,7 +20,8 @@ export default function apiPublishCallViaWeb(
const isMarkdown = filePath && typeof filePath === 'object' && filePath.type === 'text/markdown'; const isMarkdown = filePath && typeof filePath === 'object' && filePath.type === 'text/markdown';
if (!filePath && !remoteUrl) { if (!filePath && !remoteUrl) {
return apiCall(method, params, resolve, reject); const { claim_id: claimId, ...otherParams } = params;
return apiCall(method, otherParams, resolve, reject);
} }
let fileField = filePath; let fileField = filePath;