From 45f7cecffab81a0d095a28f689c6e2039dc05ffd Mon Sep 17 00:00:00 2001 From: Matteo Cargnelutti Date: Thu, 31 Oct 2024 13:16:48 -0400 Subject: [PATCH] Clean-up video metadata string before saving it As discussed w/ @bensteinberg and @rebeccacremona --- Scoop.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scoop.js b/Scoop.js index 3b79006..e6f41f3 100644 --- a/Scoop.js +++ b/Scoop.js @@ -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)