Skip to content

Commit

Permalink
Merge pull request #57 from DaddyFrosty/main
Browse files Browse the repository at this point in the history
Added skipping processing wait
  • Loading branch information
fawazahmed0 authored Nov 2, 2021
2 parents ec4b02e + e5367b8 commit 46623c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 46623c2

Please sign in to comment.