Skip to content

Commit

Permalink
Fix error and await storyboard creation
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Dec 27, 2022
1 parent 69c2f5c commit d932d8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ export default Vue.extend({

if (typeof result.player_response.storyboards !== 'undefined') {
const templateUrl = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
this.createLocalStoryboardUrls(templateUrl)
await this.createLocalStoryboardUrls(templateUrl)
}
}

Expand Down Expand Up @@ -1328,12 +1328,13 @@ export default Vue.extend({
if (process.env.NODE_ENV === 'development') {
fileLocation = `static/storyboards/${this.videoId}.vtt`
uriSchema = `storyboards/${this.videoId}.vtt`
// if the location does not exist, writeFileSync will not create the directory, so we have to do that manually
// if the location does not exist, writeFile will not create the directory, so we have to do that manually
if (!(await pathExists('static/storyboards/'))) {
fs.mkdir('static/storyboards/')
} else if (await pathExists(fileLocation)) {
await fs.rm(fileLocation)
}

await fs.rm(fileLocation)
await fs.writeFile(fileLocation, results)
} else {
if (!(await pathExists(`${userData}/storyboards/`))) {
Expand Down

0 comments on commit d932d8a

Please sign in to comment.