diff --git a/ApiClient.js b/ApiClient.js
index 7a90b12c9b..375aacbce6 100644
--- a/ApiClient.js
+++ b/ApiClient.js
@@ -655,6 +655,20 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
+ self.resetLiveTvTuner = function (id) {
+
+ if (!id) {
+ throw new Error("null id");
+ }
+
+ var url = self.getUrl("LiveTv/Tuners/" + id + "/Reset");
+
+ return self.ajax({
+ type: "POST",
+ url: url
+ });
+ };
+
self.getLiveTvSeriesTimers = function (options) {
var url = self.getUrl("LiveTv/SeriesTimers", options || {});
diff --git a/dashboard-ui/livetvstatus.html b/dashboard-ui/livetvstatus.html
index 0245c64d10..86feb6dff8 100644
--- a/dashboard-ui/livetvstatus.html
+++ b/dashboard-ui/livetvstatus.html
@@ -23,7 +23,23 @@
diff --git a/dashboard-ui/scripts/livetvstatus.js b/dashboard-ui/scripts/livetvstatus.js
index 746a163030..b0ffe6fb84 100644
--- a/dashboard-ui/scripts/livetvstatus.js
+++ b/dashboard-ui/scripts/livetvstatus.js
@@ -1,5 +1,76 @@
(function ($, document, window) {
+ function resetTuner(page, id) {
+
+ var message = 'Are you sure you wish to reset this tuner? Any active players or recordings will be abruptly stopped.';
+
+ Dashboard.confirm(message, "Reset Tuner", function (confirmResult) {
+
+ if (confirmResult) {
+
+ Dashboard.showLoadingMsg();
+
+ ApiClient.resetLiveTvTuner(id).done(function () {
+
+ Dashboard.hideLoadingMsg();
+
+ reload(page);
+ });
+ }
+ });
+ }
+
+ function renderTuners(page, tuners) {
+
+ var html = '';
+
+ for (var i = 0, length = tuners.length; i < length; i++) {
+
+ var tuner = tuners[i];
+
+ html += '
';
+
+ html += '';
+ html += tuner.Name;
+ html += ' | ';
+
+ html += '';
+ html += tuner.SourceType;
+ html += ' | ';
+
+ html += '';
+ html += tuner.Status;
+ html += ' | ';
+
+ html += '';
+
+ if (tuner.ProgramName) {
+ html += tuner.ProgramName;
+ }
+
+ html += ' | ';
+
+ html += '';
+ html += tuner.Clients.join(' ');
+ html += ' | ';
+
+ html += '';
+ html += '';
+ html += ' | ';
+
+ html += '
';
+ }
+
+ var elem = $('.tunersResultBody', page).html(html).parents('.tblTuners').table("refresh").trigger('create');
+
+ $('.btnResetTuner', elem).on('click', function () {
+
+ var id = this.getAttribute('data-tunerid');
+
+ resetTuner(page, id);
+ });
+ }
+
function loadPage(page, liveTvInfo) {
if (liveTvInfo.IsEnabled) {
@@ -29,7 +100,7 @@
else {
versionHtml += '

Up to date!';
}
-
+
$('#activeServiceVersion', page).html(versionHtml);
var status = liveTvInfo.Status;
@@ -48,20 +119,27 @@
$('#activeServiceStatus', page).html(status);
+ renderTuners(page, service.Tuners || []);
+
Dashboard.hideLoadingMsg();
}
- $(document).on('pageshow', "#liveTvStatusPage", function () {
+ function reload(page) {
Dashboard.showLoadingMsg();
- var page = this;
-
ApiClient.getLiveTvInfo().done(function (liveTvInfo) {
loadPage(page, liveTvInfo);
});
+ }
+
+ $(document).on('pageshow', "#liveTvStatusPage", function () {
+
+ var page = this;
+
+ reload(page);
});
diff --git a/packages.config b/packages.config
index d1427603d5..4957f35637 100644
--- a/packages.config
+++ b/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file