mirror of
https://git.wetfence.xyz/RandyTheSilly/jellyPod.git
synced 2026-10-26 23:39:56 -04:00
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,33 @@
|
||||
module.exports = [
|
||||
{
|
||||
"type": "heading",
|
||||
"defaultValue": "JellyPod | Settings"
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"items": [
|
||||
{
|
||||
"id": "base_url",
|
||||
"type": "input",
|
||||
"messageKey": "PRIV_BASE_URL",
|
||||
"label": "Base URL"
|
||||
},
|
||||
{
|
||||
"id": "api_key",
|
||||
"type": "input",
|
||||
"messageKey": "PRIV_API_KEY",
|
||||
"label": "API Key"
|
||||
},
|
||||
{
|
||||
"id": "username",
|
||||
"type": "input",
|
||||
"messageKey": "PRIV_USERNAME",
|
||||
"label": "Username"
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "submit",
|
||||
"defaultValue": "Save/Sync Library"
|
||||
}
|
||||
];
|
||||
@@ -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