From 827c7e73213cb67baecad2da2e08dc992090385f Mon Sep 17 00:00:00 2001 From: pomeloy <45542782+pomeloy@users.noreply.github.com> Date: Sun, 17 Mar 2024 08:02:02 +0100 Subject: [PATCH] Fix Apprise/Pushover notification title (#94) --- lib/notification/adapter/apprise.js | 5 +++-- lib/notification/adapter/pushover.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/notification/adapter/apprise.js b/lib/notification/adapter/apprise.js index 1047d42..d9c0672 100644 --- a/lib/notification/adapter/apprise.js +++ b/lib/notification/adapter/apprise.js @@ -7,13 +7,14 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) = const job = getJob(jobKey); const jobName = job == null ? jobKey : job.name; const promises = newListings.map((newListing) => { - const message = `Address: ${newListing.address}\nSize: ${newListing.size}\nPrice: ${newListing.price}\nURL: ${newListing.link}`; + const title = `${jobName} at ${serviceName}: ${newListing.title}`; + const message = `Address: ${newListing.address}\nSize: ${newListing.size}\nPrice: ${newListing.price}\Link: ${newListing.link}`; return fetch(server, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ body: message, - title: newListing.title, + title: title, }), }); }); diff --git a/lib/notification/adapter/pushover.js b/lib/notification/adapter/pushover.js index 608ee24..8bc0324 100644 --- a/lib/notification/adapter/pushover.js +++ b/lib/notification/adapter/pushover.js @@ -7,7 +7,7 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) = const job = getJob(jobKey); const jobName = job == null ? jobKey : job.name; const promises = newListings.map((newListing) => { - const title = `${serviceName}: ${newListing.title}`; + const title = `${jobName} at ${serviceName}: ${newListing.title}`; const message = `Address: ${newListing.address}\nSize: ${newListing.size}\nPrice: ${newListing.price}\nLink: ${newListing.link}`; return fetch('https://api.pushover.net/1/messages.json', { method: 'POST', @@ -17,7 +17,7 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) = user: user, message: message, device: device, - title: newListing.title, + title: title, }), }); });