From 5ffb53d0eb0cdbdd3493c9b23048dd2b4c407d63 Mon Sep 17 00:00:00 2001 From: Nick Funk Date: Mon, 10 Aug 2020 14:59:30 -0600 Subject: [PATCH] Add media to comment data downloads (#3089) This will update the admin and user CSV downloads to include a "Media" column that will specify the media type and the URL for the media content. CORL-1188 Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- src/core/server/services/users/download/download.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/server/services/users/download/download.ts b/src/core/server/services/users/download/download.ts index b7d87e2d4..5c4d9dee3 100644 --- a/src/core/server/services/users/download/download.ts +++ b/src/core/server/services/users/download/download.ts @@ -85,6 +85,7 @@ export async function sendUserDownload( "Article URL", "Comment URL", "Comment Text", + "Media", ]); /** @@ -109,7 +110,11 @@ export async function sendUserDownload( const body = htmlToText.fromString(revision.body); const commentURL = getURLWithCommentID(story.url, comment.id); - csv.write([comment.id, createdAt, story.url, commentURL, body]); + const media = revision.media + ? `${revision.media.type}: ${revision.media.url}` + : ""; + + csv.write([comment.id, createdAt, story.url, commentURL, body, media]); } commentBatch = [];