Skip to content

Commit

Permalink
Fix Apprise/Pushover notification title (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomeloy authored Mar 17, 2024
1 parent 7b63dc7 commit 827c7e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/notification/adapter/apprise.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/notification/adapter/pushover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -17,7 +17,7 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) =
user: user,
message: message,
device: device,
title: newListing.title,
title: title,
}),
});
});
Expand Down

0 comments on commit 827c7e7

Please sign in to comment.