From e173c12d43507e3824ded7a5d01bbbc110780698 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Fri, 28 Jul 2023 17:54:47 +0700 Subject: [PATCH] add metadata to google storage --- lib/record/google-storage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/record/google-storage.js b/lib/record/google-storage.js index a833504..842e221 100644 --- a/lib/record/google-storage.js +++ b/lib/record/google-storage.js @@ -9,7 +9,9 @@ class GoogleStorageUploadStream extends Writable { const storage = new Storage(opts.bucketCredential); this.gcsFile = storage.bucket(opts.bucketName).file(opts.Key); - this.writeStream = this.gcsFile.createWriteStream(); + this.writeStream = this.gcsFile.createWriteStream({ + metadata: opts.metadata + }); this.writeStream.on('error', (err) => console.error(err)); this.writeStream.on('finish', () => console.log('Upload completed.'));