add ability to create timer

This commit is contained in:
Luke Pulverenti
2013-12-17 15:02:12 -05:00
parent df1576c039
commit 533a7b218d
13 changed files with 291 additions and 45 deletions

View File

@@ -495,6 +495,7 @@ namespace MediaBrowser.WebDashboard.Api
"livetvchannel.js",
"livetvchannels.js",
"livetvguide.js",
"livetvnewrecording.js",
"livetvrecording.js",
"livetvrecordings.js",
"livetvtimer.js",

View File

@@ -389,13 +389,21 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
self.getLiveTvChannel = function (id) {
self.getLiveTvChannel = function (id, userId) {
if (!id) {
throw new Error("null id");
}
var url = self.getUrl("LiveTv/Channels/" + id);
var options = {
};
if (userId) {
options.userId = userId;
}
var url = self.getUrl("LiveTv/Channels/" + id, options);
return self.ajax({
type: "GET",
@@ -437,13 +445,44 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
self.getLiveTvRecording = function (id) {
self.getLiveTvRecording = function (id, userId) {
if (!id) {
throw new Error("null id");
}
var url = self.getUrl("LiveTv/Recordings/" + id);
var options = {
};
if (userId) {
options.userId = userId;
}
var url = self.getUrl("LiveTv/Recordings/" + id, options);
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
self.getLiveTvProgram = function (id, userId) {
if (!id) {
throw new Error("null id");
}
var options = {
};
if (userId) {
options.userId = userId;
}
var url = self.getUrl("LiveTv/Programs/" + id, options);
return self.ajax({
type: "GET",
@@ -506,6 +545,17 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
self.getNewLiveTvTimerDefaults = function () {
var url = self.getUrl("LiveTv/Timers/Defaults");
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
self.createLiveTvTimer = function (item) {
if (!item) {

View File

@@ -94,6 +94,9 @@
<Content Include="dashboard-ui\livetvchannel.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\livetvnewrecording.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\livetvrecording.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -361,6 +364,9 @@
<Content Include="dashboard-ui\livetvtimer.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvnewrecording.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvrecording.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.206" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.209" targetFramework="net45" />
</packages>