Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added skipping processing wait #57

Merged
merged 3 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Video {
function?: any
thumbnail?: string
onSuccess?: Function
skipProcessingWait?: boolean
}

export interface VideoToEdit {
Expand Down
8 changes: 6 additions & 2 deletions src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ async function uploadVideo(videoJSON: Video) {
await fileChooser.accept([pathToFile])
// Wait for upload to complete
await page.waitForXPath('//*[contains(text(),"Upload complete")]', { timeout: 0 })
// Wait for upload to go away and processing to start
await page.waitForXPath('//*[contains(text(),"Upload complete")]', { hidden: true, timeout: 0 })
// Wait for upload to go away and processing to start, skip the wait if the user doesn't want it.
if ( !videoJSON.skipProcessingWait ) {
await page.waitForXPath('//*[contains(text(),"Upload complete")]', { hidden: true, timeout: 0 })
} else {
await sleep(5000)
}
// Wait until title & description box pops up
if (thumb) {
const [thumbChooser] = await Promise.all([
Expand Down