Skip to content

Commit

Permalink
Merge pull request #376 from harvard-lil/video-metadata-cleanup
Browse files Browse the repository at this point in the history
Clean-up video metadata string before saving it
  • Loading branch information
matteocargnelutti authored Oct 31, 2024
2 parents d1343dc + 45f7cec commit 6b9b298
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Scoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,14 @@ export class Scoop {
}
}

// Merge parsed metadata into a single JSON string and clean it before saving it
const metadataAsJSON = JSON
.stringify(metadataParsed, null, 2)
.replaceAll(this.captureTmpFolderPath, '')

const url = 'file:///video-extracted-metadata.json'
const httpHeaders = new Headers({ 'content-type': 'application/json' })
const body = Buffer.from(JSON.stringify(metadataParsed, null, 2))
const body = Buffer.from(metadataAsJSON)
const isEntryPoint = false

this.addGeneratedExchange(url, httpHeaders, body, isEntryPoint)
Expand Down

0 comments on commit 6b9b298

Please sign in to comment.