Merge pull request #283 from lbryio/feat-transcoding
enable optimize_file flag in lbry publish
This commit is contained in:
commit
b2897c3cd5
3 changed files with 20 additions and 5 deletions
13
dist/bundle.es.js
vendored
13
dist/bundle.es.js
vendored
|
@ -3945,7 +3945,8 @@ const doPublish = (success, fail) => (dispatch, getState) => {
|
|||
fee,
|
||||
uri,
|
||||
tags,
|
||||
locations
|
||||
locations,
|
||||
optimize
|
||||
} = 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;
|
||||
|
@ -4013,6 +4014,10 @@ const doPublish = (success, fail) => (dispatch, getState) => {
|
|||
publishPayload.fee_amount = creditsToString(fee.amount);
|
||||
}
|
||||
|
||||
if (optimize) {
|
||||
publishPayload.optimize_file = true;
|
||||
}
|
||||
|
||||
// Only pass file on new uploads, not metadata only edits.
|
||||
// The sdk will figure it out
|
||||
if (filePath) publishPayload.file_path = filePath;
|
||||
|
@ -5498,7 +5503,8 @@ const defaultState$6 = {
|
|||
tags: [],
|
||||
publishing: false,
|
||||
publishSuccess: false,
|
||||
publishError: undefined
|
||||
publishError: undefined,
|
||||
optimize: false
|
||||
};
|
||||
|
||||
const publishReducer = handleActions({
|
||||
|
@ -5506,7 +5512,8 @@ const publishReducer = handleActions({
|
|||
const { data } = action;
|
||||
return _extends$e({}, state, data);
|
||||
},
|
||||
[CLEAR_PUBLISH]: () => _extends$e({}, defaultState$6),
|
||||
[CLEAR_PUBLISH]: state => _extends$e({}, defaultState$6, { bid: state.bid, optimize: state.optimize
|
||||
}),
|
||||
[PUBLISH_START]: state => _extends$e({}, state, {
|
||||
publishing: true,
|
||||
publishSuccess: false
|
||||
|
|
|
@ -264,6 +264,7 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
uri,
|
||||
tags,
|
||||
locations,
|
||||
optimize,
|
||||
} = 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;
|
||||
|
@ -301,6 +302,7 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
tags: Array<string>,
|
||||
locations?: Array<any>,
|
||||
blocking: boolean,
|
||||
optimize_file?: boolean,
|
||||
} = {
|
||||
name,
|
||||
title,
|
||||
|
@ -350,6 +352,10 @@ export const doPublish = (success: Function, fail: Function) => (
|
|||
publishPayload.fee_amount = creditsToString(fee.amount);
|
||||
}
|
||||
|
||||
if (optimize) {
|
||||
publishPayload.optimize_file = true;
|
||||
}
|
||||
|
||||
// Only pass file on new uploads, not metadata only edits.
|
||||
// The sdk will figure it out
|
||||
if (filePath) publishPayload.file_path = filePath;
|
||||
|
|
|
@ -28,6 +28,7 @@ type PublishState = {
|
|||
otherLicenseDescription: string,
|
||||
licenseUrl: string,
|
||||
tags: Array<string>,
|
||||
optimize: boolean,
|
||||
};
|
||||
|
||||
const defaultState: PublishState = {
|
||||
|
@ -58,6 +59,7 @@ const defaultState: PublishState = {
|
|||
publishing: false,
|
||||
publishSuccess: false,
|
||||
publishError: undefined,
|
||||
optimize: false,
|
||||
};
|
||||
|
||||
export const publishReducer = handleActions(
|
||||
|
@ -69,8 +71,8 @@ export const publishReducer = handleActions(
|
|||
...data,
|
||||
};
|
||||
},
|
||||
[ACTIONS.CLEAR_PUBLISH]: (): PublishState => ({
|
||||
...defaultState,
|
||||
[ACTIONS.CLEAR_PUBLISH]: (state: PublishState): PublishState => ({
|
||||
...defaultState, bid: state.bid, optimize: state.optimize,
|
||||
}),
|
||||
[ACTIONS.PUBLISH_START]: (state: PublishState): PublishState => ({
|
||||
...state,
|
||||
|
|
Loading…
Add table
Reference in a new issue