Add release time to publish
This commit is contained in:
parent
37f17fae0c
commit
5ea369ee76
3 changed files with 26 additions and 2 deletions
20
dist/bundle.es.js
vendored
20
dist/bundle.es.js
vendored
|
@ -1532,6 +1532,18 @@ function buildURI(UrlObj, includeProto = true, protoDefault = 'lbry://') {
|
|||
deprecatedParts = _objectWithoutProperties(UrlObj, ['streamName', 'streamClaimId', 'channelName', 'channelClaimId', 'primaryClaimSequence', 'primaryBidPosition', 'secondaryClaimSequence', 'secondaryBidPosition', 'startTime']);
|
||||
const { claimId, claimName, contentName } = deprecatedParts;
|
||||
|
||||
{
|
||||
if (claimId) {
|
||||
console.error(__("'claimId' should no longer be used. Use 'streamClaimId' or 'channelClaimId' instead"));
|
||||
}
|
||||
if (claimName) {
|
||||
console.error(__("'claimName' should no longer be used. Use 'streamClaimName' or 'channelClaimName' instead"));
|
||||
}
|
||||
if (contentName) {
|
||||
console.error(__("'contentName' should no longer be used. Use 'streamName' instead"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!claimName && !channelName && !streamName) {
|
||||
console.error(__("'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url."));
|
||||
}
|
||||
|
@ -4625,6 +4637,7 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
|
|||
currency: 'LBC'
|
||||
},
|
||||
languages,
|
||||
release_time,
|
||||
license,
|
||||
license_url: licenseUrl,
|
||||
thumbnail,
|
||||
|
@ -4640,6 +4653,7 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
|
|||
description,
|
||||
fee,
|
||||
languages,
|
||||
release_time: release_time ? Number(release_time) * 1000 : undefined,
|
||||
thumbnail: thumbnail ? thumbnail.url : null,
|
||||
title,
|
||||
uri,
|
||||
|
@ -4690,6 +4704,7 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => {
|
|||
filePath,
|
||||
description,
|
||||
language,
|
||||
release_time,
|
||||
license,
|
||||
licenseUrl,
|
||||
useLBRYUploader,
|
||||
|
@ -4757,7 +4772,9 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => {
|
|||
}
|
||||
|
||||
// Set release time to curret date. On edits, keep original release/transaction time as release_time
|
||||
if (myClaimForUriEditing && myClaimForUriEditing.value.release_time) {
|
||||
if (release_time) {
|
||||
publishPayload.release_time = Number(Math.round(new Date(release_time) / 1000));
|
||||
} else if (myClaimForUriEditing && myClaimForUriEditing.value.release_time) {
|
||||
publishPayload.release_time = Number(myClaimForUri.value.release_time);
|
||||
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
||||
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
||||
|
@ -5930,6 +5947,7 @@ const defaultState$4 = {
|
|||
uploadThumbnailStatus: API_DOWN,
|
||||
description: '',
|
||||
language: '',
|
||||
release_time: undefined,
|
||||
nsfw: false,
|
||||
channel: CHANNEL_ANONYMOUS,
|
||||
channelId: '',
|
||||
|
|
|
@ -184,6 +184,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
|
|||
currency: 'LBC',
|
||||
},
|
||||
languages,
|
||||
release_time,
|
||||
license,
|
||||
license_url: licenseUrl,
|
||||
thumbnail,
|
||||
|
@ -199,6 +200,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
|
|||
description,
|
||||
fee,
|
||||
languages,
|
||||
release_time: release_time ? Number(release_time) * 1000 : undefined,
|
||||
thumbnail: thumbnail ? thumbnail.url : null,
|
||||
title,
|
||||
uri,
|
||||
|
@ -252,6 +254,7 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
|
|||
filePath,
|
||||
description,
|
||||
language,
|
||||
release_time,
|
||||
license,
|
||||
licenseUrl,
|
||||
useLBRYUploader,
|
||||
|
@ -339,7 +342,9 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
|
|||
}
|
||||
|
||||
// Set release time to curret date. On edits, keep original release/transaction time as release_time
|
||||
if (myClaimForUriEditing && myClaimForUriEditing.value.release_time) {
|
||||
if (release_time) {
|
||||
publishPayload.release_time = Number(Math.round(new Date(release_time) / 1000));
|
||||
} else if (myClaimForUriEditing && myClaimForUriEditing.value.release_time) {
|
||||
publishPayload.release_time = Number(myClaimForUri.value.release_time);
|
||||
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
||||
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
||||
|
|
|
@ -54,6 +54,7 @@ const defaultState: PublishState = {
|
|||
uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN,
|
||||
description: '',
|
||||
language: '',
|
||||
release_time: undefined,
|
||||
nsfw: false,
|
||||
channel: CHANNEL_ANONYMOUS,
|
||||
channelId: '',
|
||||
|
|
Loading…
Reference in a new issue