ded021cc76
## Issue `params` is the "final" value that will be passed to the SDK and `channel` is not a valid argument (it should be `channel_name`). Also, it seems like we only pass the channel ID now and skip the channel name entirely. For the anonymous case, a clash will still happen when since the channel part is hardcoded to `anonymous`. ## Approach Generate a guid in `params` and use that as the key to handle all the cases above. We couldn't use the `uploadUrl` because v1 doesn't have it. The old formula is retained to allow users to retry or cancel their existing uploads one last time (otherwise it will persist forever). The next upload will be using the new key.
78 lines
1.5 KiB
JavaScript
78 lines
1.5 KiB
JavaScript
// @flow
|
|
|
|
declare type UpdatePublishFormData = {
|
|
filePath?: string,
|
|
contentIsFree?: boolean,
|
|
fee?: {
|
|
amount: string,
|
|
currency: string,
|
|
},
|
|
title?: string,
|
|
thumbnail_url?: string,
|
|
uploadThumbnailStatus?: string,
|
|
thumbnailPath?: string,
|
|
thumbnailError?: boolean,
|
|
description?: string,
|
|
language?: string,
|
|
channel?: string,
|
|
channelId?: string,
|
|
name?: string,
|
|
nameError?: string,
|
|
bid?: number,
|
|
bidError?: string,
|
|
otherLicenseDescription?: string,
|
|
licenseUrl?: string,
|
|
licenseType?: string,
|
|
uri?: string,
|
|
nsfw: boolean,
|
|
isMarkdownPost?: boolean,
|
|
};
|
|
|
|
declare type PublishParams = {
|
|
name: ?string,
|
|
bid: ?number,
|
|
filePath?: string,
|
|
description: ?string,
|
|
language: string,
|
|
publishingLicense?: string,
|
|
publishingLicenseUrl?: string,
|
|
thumbnail: ?string,
|
|
channel: string,
|
|
channelId?: string,
|
|
title: string,
|
|
contentIsFree: boolean,
|
|
uri?: string,
|
|
license: ?string,
|
|
licenseUrl: ?string,
|
|
fee?: {
|
|
amount: string,
|
|
currency: string,
|
|
},
|
|
claim: StreamClaim,
|
|
nsfw: boolean,
|
|
tags: Array<Tag>,
|
|
};
|
|
|
|
declare type TusUploader = any;
|
|
|
|
declare type FileUploadSdkParams = {
|
|
file_path: string,
|
|
name: ?string,
|
|
preview?: boolean,
|
|
remote_url?: string,
|
|
thumbnail_url?: string,
|
|
title?: string,
|
|
// Temporary values; remove when passing to SDK
|
|
guid: string,
|
|
uploadUrl?: string,
|
|
};
|
|
|
|
declare type FileUploadItem = {
|
|
params: FileUploadSdkParams,
|
|
file: File,
|
|
fileFingerprint: string,
|
|
progress: string,
|
|
status?: string,
|
|
uploader?: TusUploader | XMLHttpRequest,
|
|
resumable: boolean,
|
|
};
|