Compare commits

...

1 commit

Author SHA1 Message Date
Sean Yesmunt
030df2cde3 livestream changes 2021-01-19 16:31:13 -05:00
3 changed files with 61 additions and 2 deletions

32
dist/bundle.es.js vendored
View file

@ -4347,6 +4347,7 @@ const selectPublishFormValues = reselect.createSelector(selectState$3, state =>
} else {
actualLanguage = language || languageSet || 'en';
}
return _extends$6({}, formValues, { language: actualLanguage });
});
const makeSelectPublishFormValue = item => reselect.createSelector(selectState$3, state => state[item]);
@ -4624,8 +4625,10 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => {
uri,
tags,
locations,
optimize
optimize,
isLivestreamPublish
} = publishData;
// Handle scenario where we have a claim that has the same name as a channel we are publishing with.
const myClaimForUriEditing = myClaimForUri && myClaimForUri.name === name ? myClaimForUri : null;
@ -4705,6 +4708,33 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => {
// The sdk will figure it out
if (filePath) publishPayload.file_path = filePath;
if (isLivestreamPublish) {
var d = new Date();
// Set it to one month in future so it's hidden in apps
d.setFullYear(d.getFullYear() - 10);
d.setHours(0, 0, 0);
d.setMilliseconds(0);
const releaseTimeInSeconds = d / 1000;
publishPayload.release_time = releaseTimeInSeconds;
if (publishPayload.tags) {
if (!publishPayload.tags.includes('odysee-livestream')) {
publishPayload.tags.push('odysee-livestream');
}
} else {
publishPayload.tags = ['odysee-livestream'];
}
} else if (publishPayload.tags && publishPayload.tags.includes('odysee-livestream')) {
let newReleaseTime = new Date();
newReleaseTime.setMilliseconds(0);
publishPayload.release_time = newReleaseTime / 1000;
publishPayload.tags = publishPayload.tags.filter(tag => tag !== 'odysee-livestream');
}
if (preview) {
publishPayload.preview = true;
publishPayload.optimize_file = false;

View file

@ -266,7 +266,9 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
tags,
locations,
optimize,
isLivestreamPublish,
} = publishData;
// Handle scenario where we have a claim that has the same name as a channel we are publishing with.
const myClaimForUriEditing = myClaimForUri && myClaimForUri.name === name ? myClaimForUri : null;
@ -292,7 +294,6 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
description?: string,
channel_id?: string,
file_path?: string,
license_url?: string,
license?: string,
thumbnail_url?: string,
@ -367,6 +368,33 @@ export const doPublish = (success: Function, fail: Function, preview: Function)
// The sdk will figure it out
if (filePath) publishPayload.file_path = filePath;
if (isLivestreamPublish) {
var d = new Date();
// Set it to one month in future so it's hidden in apps
d.setFullYear(d.getFullYear() - 10);
d.setHours(0, 0, 0);
d.setMilliseconds(0);
const releaseTimeInSeconds = d / 1000;
publishPayload.release_time = releaseTimeInSeconds;
if (publishPayload.tags) {
if (!publishPayload.tags.includes('odysee-livestream')) {
publishPayload.tags.push('odysee-livestream');
}
} else {
publishPayload.tags = ['odysee-livestream'];
}
} else if (publishPayload.tags && publishPayload.tags.includes('odysee-livestream')) {
let newReleaseTime = new Date();
newReleaseTime.setMilliseconds(0);
publishPayload.release_time = newReleaseTime / 1000;
publishPayload.tags = publishPayload.tags.filter(tag => tag !== 'odysee-livestream');
}
if (preview) {
publishPayload.preview = true;
publishPayload.optimize_file = false;

View file

@ -54,6 +54,7 @@ export const selectPublishFormValues = createSelector(
} else {
actualLanguage = language || languageSet || 'en';
}
return { ...formValues, language: actualLanguage };
}
);