re-add /sendemail and improve cider

This commit is contained in:
Enstrayed
2024-02-10 14:38:58 -08:00
parent 87afed5b32
commit 29ef51f045
4 changed files with 134 additions and 67 deletions

View File

@@ -19,9 +19,15 @@ app.get("/cider", (rreq,rres) => { // GET current listening from target
"songName": res.info.name,
"artistName": res.info.artistName,
"albumName": res.info.albumName,
"artworkUrl": res.info.artwork.url,
"songLinkUrl": res.info.url.songLink
"songLinkUrl": res.info.url.songLink,
"endtimeEpochInMs": res.info.endTime
};
// Formats info.artwork.url from upstream Cider Endpoint
let workingArtworkUrl = res.info.artwork.url
workingArtworkUrl = workingArtworkUrl.replace("{w}",res.info.artwork.width)
workingArtworkUrl = workingArtworkUrl.replace("{h}",res.info.artwork.height)
currentListening.artworkUrl = workingArtworkUrl
rres.set("Access-Control-Allow-Origin","*")
rres.send(currentListening) // send freshly cached json