Initial code commit
This commit is contained in:
1 parent
6a535a40d2
commit
b12f84cb66
12 files changed
+637
-1
No files matched your search
@@ -0,0 +1,54 @@
|
||||
var Clay = require('@rebble/clay');
|
||||
var clayConfig = require('./config');
|
||||
new Clay(clayConfig);
|
||||
|
||||
Pebble.addEventListener("ready", function () {
|
||||
Pebble.sendAppMessage({ PKJS_READY: 1 });
|
||||
});
|
||||
|
||||
function callAPI(method, endpoint) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.onload = function () {
|
||||
switch (xhr.status) {
|
||||
case 200:
|
||||
return this.responseText;
|
||||
default:
|
||||
reportAPIFailure(); // TODO
|
||||
}
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
reportAPIFailure(); // TODO
|
||||
};
|
||||
xhr.ontimeout = function () {
|
||||
reportAPIFailure(); // TODO
|
||||
};
|
||||
|
||||
xhr.open(method, endpoint, true);
|
||||
xhr.timeout = 8000;
|
||||
xhr.setRequestHeader("Accept", "application/json");
|
||||
xhr.setRequestHeader("Authorization", 'MediaBrowser Token="' + apiKey + '"'); // TODO
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
// On Settings Save/Sync Button Press
|
||||
//// Get User ID
|
||||
|
||||
//curl -H "Authorization: MediaBrowser Token=\"TOKEN\"" -X GET 'BASEURL/Users'
|
||||
|
||||
// Get Track List Using Logic From JellyPod Server
|
||||
|
||||
// On Every Startup
|
||||
//// Get Session ID
|
||||
|
||||
//curl -H "Authorization: MediaBrowser Token=\"TOKEN\"" -X GET 'BASEURL/Sessions'
|
||||
|
||||
// Filter by:
|
||||
// UserId
|
||||
// Sort by:
|
||||
// LastActivityDate
|
||||
|
||||
// Controls
|
||||
//// Select Track (pass through a queue)
|
||||
|
||||
//curl - H "Authorization: MediaBrowser Token=\"TOKEN\"" - X POST 'BASEURL/Sessions/SESSIONID/Playing?playCommand=PlayNow&itemIds=XXX,YYY'
|
||||
Reference in new issue
Block a user