Optimize app message in/outbox sizes; truncate lastWatched before sending to watch (if needed)

This commit is contained in:
RandyTheSilly committed 2026-05-10 01:17:24 -04:00
1 parent 1c1140246a
commit 1e884dd4a4
2 files changed
+6 -2

No files matched your search

+5 -1
View File
@@ -129,7 +129,11 @@ function callAPI(fullURL, apiKey, isJellyfin, trackedUser, sleepTimestamp) {
});
}
if (lastWatched != "") {
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: lastWatched });
if (lastWatched.length <= 1536) {
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: lastWatched });
} else {
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: lastWatched.slice(0, 1536) });
}
} else {
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: "NO WATCH HISTORY FOUND FOR USER " + trackedUser });
}