Send and display last watched on watch

This commit is contained in:
2026-04-22 22:17:28 -04:00
parent 017051ccbe
commit 6ad8ced5bb
3 changed files with 38 additions and 42 deletions

View File

@@ -33,7 +33,7 @@ function callAPI(fullURL, apiKey, isJellyfin, trackedUser, sleepTimestamp) {
if (resp && ((isJellyfin === true && Array.isArray(resp.Items)) || (isJellyfin === false && Array.isArray(resp.response.data.data)))) {
let delta;
let bestDelta = Infinity;
let lastWatched = null;
let lastWatched = "";
if (isJellyfin === true) {
const re = /^(.+) is playing (.+) on .*$/;
let arr;
@@ -64,8 +64,10 @@ function callAPI(fullURL, apiKey, isJellyfin, trackedUser, sleepTimestamp) {
}
});
}
if (lastWatched != null) {
if (lastWatched != "") {
console.log("Last watched: " + lastWatched);
var dict = { 'PKJS_LAST_WATCHED': lastWatched }
Pebble.sendAppMessage(dict);
}
}
}