From 87d9ef9abb10c00199144add2c6da597f3d1c3c8 Mon Sep 17 00:00:00 2001 From: Andrew Roberts Date: Mon, 24 Jul 2023 23:34:02 -0400 Subject: [PATCH] add path to download complete notification body --- backend/notifications.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/notifications.js b/backend/notifications.js index 0cb51d1..616da01 100644 --- a/backend/notifications.js +++ b/backend/notifications.js @@ -21,7 +21,7 @@ const NOTIFICATION_TYPE_TO_TITLE = { const NOTIFICATION_TYPE_TO_BODY = { task_finished: (notification) => notification['data']['task_title'], - download_complete: (notification) => {return `${notification['data']['file_title']}\nOriginal URL: ${notification['data']['original_url']}`}, + download_complete: (notification) => {return `${notification['data']['file_title']}\nOriginal URL: ${notification['data']['original_url']}\nPath: ${notification['data']['file_path']}`}, download_error: (notification) => {return `Error: ${notification['data']['download_error_message']}\nError code: ${notification['data']['download_error_type']}\n\nOriginal URL: ${notification['data']['download_url']}`} } @@ -84,7 +84,7 @@ exports.sendTaskNotification = async (task_obj, confirmed) => { exports.sendDownloadNotification = async (file, user_uid) => { if (!notificationEnabled('download_complete')) return; - const data = {file_uid: file.uid, file_title: file.title, file_thumbnail: file.thumbnailURL, original_url: file.url}; + const data = {file_uid: file.uid, file_title: file.title, file_path: file.path, file_thumbnail: file.thumbnailURL, original_url: file.url}; const notification = exports.createNotification('download_complete', ['play'], data, user_uid); return await exports.sendNotification(notification); } @@ -246,4 +246,4 @@ function sendGenericNotification(data) { }, body: JSON.stringify(data), }); -} \ No newline at end of file +}