Send and display last watched on watch
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user