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']);
|
deprecatedParts = _objectWithoutProperties(UrlObj, ['streamName', 'streamClaimId', 'channelName', 'channelClaimId', 'primaryClaimSequence', 'primaryBidPosition', 'secondaryClaimSequence', 'secondaryBidPosition', 'startTime']);
|
||||||
const { claimId, claimName, contentName } = deprecatedParts;
|
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) {
|
if (!claimName && !channelName && !streamName) {
|
||||||
console.error(__("'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url."));
|
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'
|
currency: 'LBC'
|
||||||
},
|
},
|
||||||
languages,
|
languages,
|
||||||
|
release_time,
|
||||||
license,
|
license,
|
||||||
license_url: licenseUrl,
|
license_url: licenseUrl,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
|
@ -4640,6 +4653,7 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => {
|
||||||
description,
|
description,
|
||||||
fee,
|
fee,
|
||||||
languages,
|
languages,
|
||||||
|
release_time: release_time ? Number(release_time) * 1000 : undefined,
|
||||||
thumbnail: thumbnail ? thumbnail.url : null,
|
thumbnail: thumbnail ? thumbnail.url : null,
|
||||||
title,
|
title,
|
||||||
uri,
|
uri,
|
||||||
|
@ -4690,6 +4704,7 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => {
|
||||||
filePath,
|
filePath,
|
||||||
description,
|
description,
|
||||||
language,
|
language,
|
||||||
|
release_time,
|
||||||
license,
|
license,
|
||||||
licenseUrl,
|
licenseUrl,
|
||||||
useLBRYUploader,
|
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
|
// 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);
|
publishPayload.release_time = Number(myClaimForUri.value.release_time);
|
||||||
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
||||||
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
||||||
|
@ -5930,6 +5947,7 @@ const defaultState$4 = {
|
||||||
uploadThumbnailStatus: API_DOWN,
|
uploadThumbnailStatus: API_DOWN,
|
||||||
description: '',
|
description: '',
|
||||||
language: '',
|
language: '',
|
||||||
|
release_time: undefined,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
channel: CHANNEL_ANONYMOUS,
|
channel: CHANNEL_ANONYMOUS,
|
||||||
channelId: '',
|
channelId: '',
|
||||||
|
|
|
@ -184,6 +184,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
|
||||||
currency: 'LBC',
|
currency: 'LBC',
|
||||||
},
|
},
|
||||||
languages,
|
languages,
|
||||||
|
release_time,
|
||||||
license,
|
license,
|
||||||
license_url: licenseUrl,
|
license_url: licenseUrl,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
|
@ -199,6 +200,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis
|
||||||
description,
|
description,
|
||||||
fee,
|
fee,
|
||||||
languages,
|
languages,
|
||||||
|
release_time: release_time ? Number(release_time) * 1000 : undefined,
|
||||||
thumbnail: thumbnail ? thumbnail.url : null,
|
thumbnail: thumbnail ? thumbnail.url : null,
|
||||||
title,
|
title,
|
||||||
uri,
|
uri,
|
||||||
|
@ -252,6 +254,7 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
|
||||||
filePath,
|
filePath,
|
||||||
description,
|
description,
|
||||||
language,
|
language,
|
||||||
|
release_time,
|
||||||
license,
|
license,
|
||||||
licenseUrl,
|
licenseUrl,
|
||||||
useLBRYUploader,
|
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
|
// 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);
|
publishPayload.release_time = Number(myClaimForUri.value.release_time);
|
||||||
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
} else if (myClaimForUriEditing && myClaimForUriEditing.timestamp) {
|
||||||
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
publishPayload.release_time = Number(myClaimForUriEditing.timestamp);
|
||||||
|
|
|
@ -54,6 +54,7 @@ const defaultState: PublishState = {
|
||||||
uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN,
|
uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN,
|
||||||
description: '',
|
description: '',
|
||||||
language: '',
|
language: '',
|
||||||
|
release_time: undefined,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
channel: CHANNEL_ANONYMOUS,
|
channel: CHANNEL_ANONYMOUS,
|
||||||
channelId: '',
|
channelId: '',
|
||||||
|
|
Loading…
Reference in a new issue