aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard/ApiClient.js
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-14 20:17:57 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-14 20:17:57 -0500
commit01e65c93eeeddff27fc2e0e4833678c5cc2829a0 (patch)
tree628d2359e6d723c8f9f8865104e518add252bee1 /MediaBrowser.WebDashboard/ApiClient.js
parentd576108411d254afcbefa627cea6a2d3585ab823 (diff)
updated live tv + nuget
Diffstat (limited to 'MediaBrowser.WebDashboard/ApiClient.js')
-rw-r--r--MediaBrowser.WebDashboard/ApiClient.js98
1 files changed, 94 insertions, 4 deletions
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js
index 16e2ae3b9..53f4fde2a 100644
--- a/MediaBrowser.WebDashboard/ApiClient.js
+++ b/MediaBrowser.WebDashboard/ApiClient.js
@@ -506,20 +506,110 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
- self.createLiveTvTimer = function (options) {
+ self.createLiveTvTimer = function (item) {
- if (!options) {
- throw new Error("null options");
+ if (!item) {
+ throw new Error("null item");
}
- var url = self.getUrl("LiveTv/Timers", options);
+ var url = self.getUrl("LiveTv/Timers");
return self.ajax({
type: "POST",
+ url: url,
+ data: JSON.stringify(item),
+ contentType: "application/json"
+ });
+ };
+
+ self.updateLiveTvTimer = function (item) {
+
+ if (!item) {
+ throw new Error("null item");
+ }
+
+ var url = self.getUrl("LiveTv/Timers/" + item.Id);
+
+ return self.ajax({
+ type: "POST",
+ url: url,
+ data: JSON.stringify(item),
+ contentType: "application/json"
+ });
+ };
+
+ self.getLiveTvSeriesTimers = function (options) {
+
+ var url = self.getUrl("LiveTv/SeriesTimers", options || {});
+
+ return self.ajax({
+ type: "GET",
+ url: url,
+ dataType: "json"
+ });
+ };
+
+ self.getLiveTvSeriesTimer = function (id) {
+
+ if (!id) {
+ throw new Error("null id");
+ }
+
+ var url = self.getUrl("LiveTv/SeriesTimers/" + id);
+
+ return self.ajax({
+ type: "GET",
+ url: url,
+ dataType: "json"
+ });
+ };
+
+ self.cancelLiveTvSeriesTimer = function (id) {
+
+ if (!id) {
+ throw new Error("null id");
+ }
+
+ var url = self.getUrl("LiveTv/SeriesTimers/" + id);
+
+ return self.ajax({
+ type: "DELETE",
url: url
});
};
+ self.createLiveTvSeriesTimer = function (item) {
+
+ if (!item) {
+ throw new Error("null item");
+ }
+
+ var url = self.getUrl("LiveTv/SeriesTimers");
+
+ return self.ajax({
+ type: "POST",
+ url: url,
+ data: JSON.stringify(item),
+ contentType: "application/json"
+ });
+ };
+
+ self.updateLiveTvSeriesTimer = function (item) {
+
+ if (!item) {
+ throw new Error("null item");
+ }
+
+ var url = self.getUrl("LiveTv/SeriesTimers/" + item.Id);
+
+ return self.ajax({
+ type: "POST",
+ url: url,
+ data: JSON.stringify(item),
+ contentType: "application/json"
+ });
+ };
+
/**
* Gets the current server status
*/