-
+ |
|
diff --git a/dashboard-ui/livetvseriestimer.html b/dashboard-ui/livetvseriestimer.html
index b4e756c6a3..a92584990b 100644
--- a/dashboard-ui/livetvseriestimer.html
+++ b/dashboard-ui/livetvseriestimer.html
@@ -13,7 +13,7 @@
Series
diff --git a/dashboard-ui/livetvtimer.html b/dashboard-ui/livetvtimer.html
index 1c41c4d118..9d07401dda 100644
--- a/dashboard-ui/livetvtimer.html
+++ b/dashboard-ui/livetvtimer.html
@@ -13,7 +13,7 @@
Series
diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js
index 8dfe86d5a8..233cc33296 100644
--- a/dashboard-ui/scripts/Itemdetailpage.js
+++ b/dashboard-ui/scripts/Itemdetailpage.js
@@ -288,7 +288,7 @@
$('#players', page).hide();
}
- if (item.Artists && item.Artists.length) {
+ if (item.Artists && item.Artists.length && item.Type != "MusicAlbum") {
$('#artist', page).show().html(getArtistLinksHtml(item.Artists)).trigger('create');
} else {
$('#artist', page).hide();
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 87a6e50e79..ebe61dab12 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -2043,24 +2043,16 @@
if (item.Type == "Audio") {
miscInfo.push(Dashboard.getDisplayTime(item.RunTimeTicks));
+
} else {
minutes = item.RunTimeTicks / 600000000;
minutes = minutes || 1;
- miscInfo.push(minutes.toFixed(0) + "min");
+ miscInfo.push(Math.round(minutes) + "min");
}
}
- if (item.DurationMs) {
-
- minutes = item.DurationMs / 60000;
-
- minutes = minutes || 1;
-
- miscInfo.push(minutes.toFixed(0) + "min");
- }
-
if (item.OfficialRating && item.Type !== "Season" && item.Type !== "Episode") {
miscInfo.push(item.OfficialRating);
}
@@ -2086,17 +2078,13 @@
renderOverview: function (elem, item) {
- if (item.Overview || item.OverviewHtml) {
- var overview = item.OverviewHtml || item.Overview;
+ var overview = item.OverviewHtml || item.Overview || '';
- elem.html(overview).show().trigger('create');
+ elem.html(overview).show().trigger('create');
- $('a', elem).each(function () {
- $(this).attr("target", "_blank");
- });
- } else {
- elem.hide();
- }
+ $('a', elem).each(function () {
+ $(this).attr("target", "_blank");
+ });
},
diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js
index 6f5b17c7da..5036ca65ad 100644
--- a/dashboard-ui/scripts/livetvchannel.js
+++ b/dashboard-ui/scripts/livetvchannel.js
@@ -15,85 +15,139 @@
var html = '';
- var cssClass = "detailTable";
+ //var cssClass = "detailTable";
- html += '';
+ //html += '';
- html += '';
+ //html += ' ';
- html += ' | ';
- html += 'Date | ';
- html += 'Start | ';
- html += 'End | ';
- html += 'Name | ';
- html += 'Genre | ';
+ //html += ' | ';
+ //html += 'Date | ';
+ //html += 'Start | ';
+ //html += 'End | ';
+ //html += 'Name | ';
- html += ' ';
+ //html += '';
+
+ var currentIndexValue;
for (var i = 0, length = result.Items.length; i < length; i++) {
var program = result.Items[i];
- html += '';
-
- html += '';
-
- if (program.RecordingId) {
- html += '';
- } else {
- html += 'Record';
- }
-
- html += ' | ';
-
var startDate = program.StartDate;
+ var startDateText = '';
try {
startDate = parseISO8601Date(startDate, { toLocal: true });
+ startDateText = LibraryBrowser.getFutureDateText(startDate);
} catch (err) {
}
- html += '' + startDate.toLocaleDateString() + ' | ';
+ if (startDateText != currentIndexValue) {
- html += '' + LiveTvHelpers.getDisplayTime(program.StartDate) + ' | ';
-
- html += '' + LiveTvHelpers.getDisplayTime(program.EndDate) + ' | ';
-
- html += '';
-
- if (program.Name) {
- //html += '';
- html += program.Name;
- //html += '';
+ html += '';
+ currentIndexValue = startDateText;
}
- html += ' | ';
+ html += '';
- html += '' + program.Genres.join(' / ') + ' | ';
+ html += '';
+ html += ' ' + LiveTvHelpers.getDisplayTime(startDate) + ' ';
+ html += ' ';
- html += ' ';
+ var cssClass = "tvProgramInfo";
+
+ if (program.IsKids) {
+ cssClass += " childProgramInfo";
+ }
+ else if (program.IsSports) {
+ cssClass += " sportsProgramInfo";
+ }
+ else if (program.IsNews) {
+ cssClass += " newsProgramInfo";
+ }
+ else if (program.IsMovie) {
+ cssClass += " movieProgramInfo";
+ }
+
+ html += '';
+
+ html += ' ' + program.Name + ' ';
+
+ html += ' ';
+
+ if (program.IsLive) {
+ html += 'LIVE ';
+ }
+ else if (program.IsPremiere) {
+ html += 'PREMIERE ';
+ }
+ else if (program.IsSeries && !program.IsRepeat) {
+ html += 'NEW ';
+ }
+
+ var minutes = program.RunTimeTicks / 600000000;
+
+ minutes = Math.round(minutes || 1) + ' min';
+
+ if (program.EpisodeTitle) {
+
+ html += program.EpisodeTitle + ' (' + minutes + ')';
+ } else {
+ html += minutes;
+ }
+
+ html += ' ';
+ html += ' ';
+
+ //html += '';
+
+ //html += '';
+
+ //if (program.RecordingId) {
+ // html += '';
+ //} else {
+ // html += 'Record';
+ //}
+
+ //html += ' | ';
+
+ //var startDate = program.StartDate;
+
+ //try {
+
+ // startDate = parseISO8601Date(startDate, { toLocal: true });
+
+ //} catch (err) {
+
+ //}
+
+ //html += '' + startDate.toLocaleDateString() + ' | ';
+
+ //html += '' + LiveTvHelpers.getDisplayTime(program.StartDate) + ' | ';
+
+ //html += '' + LiveTvHelpers.getDisplayTime(program.EndDate) + ' | ';
+
+ //html += '';
+
+ //if (program.Name) {
+ // //html += '';
+ // html += program.Name;
+ // //html += '';
+ //}
+
+ //html += ' | ';
+
+ html += '';
}
- html += ' ';
+ //html += ' ';
- var elem = $('#programList', page).html(html).trigger('create');
-
- $('.btnCancelRecording', elem).on('click', function () {
-
- var recordingId = this.getAttribute('data-recordingid');
-
- cancelRecording(page, recordingId);
- });
-
- $('.btnScheduleRecording', elem).on('click', function () {
-
- var recordingId = this.getAttribute('data-recordingid');
-
- scheduleRecording(page, recordingId);
- });
+ $('#programList', page).html(html).trigger('create');
}
function loadPrograms(page) {
@@ -165,17 +219,19 @@
getDisplayTime: function (date) {
- try {
+ if ((typeof date).toString().toLowerCase() === 'string') {
+ try {
- date = parseISO8601Date(date, { toLocal: true });
+ date = parseISO8601Date(date, { toLocal: true });
- } catch (err) {
- return date;
+ } catch (err) {
+ return date;
+ }
}
date = date.toLocaleTimeString();
- date = date.replace('0:00', '0');
+ date = date.replace('0:00', '0').replace(':00 ', '').replace(' ', '');
return date;
}
diff --git a/dashboard-ui/scripts/livetvprogram.js b/dashboard-ui/scripts/livetvprogram.js
new file mode 100644
index 0000000000..6173076c75
--- /dev/null
+++ b/dashboard-ui/scripts/livetvprogram.js
@@ -0,0 +1,85 @@
+(function ($, document, apiClient) {
+
+ var currentItem;
+
+ function reload(page) {
+
+ Dashboard.showLoadingMsg();
+
+ ApiClient.getLiveTvProgram(getParameterByName('id'), Dashboard.getCurrentUserId()).done(function (item) {
+
+ var context = 'livetv';
+ currentItem = item;
+
+ var name = item.Name;
+
+ $('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
+
+ Dashboard.setPageTitle(name);
+
+ $('.itemName', page).html(name);
+ $('.itemChannelNumber', page).html('Channel: ' + item.ChannelName + '').trigger('create');
+
+ if (item.EpisodeTitle) {
+ $('.itemEpisodeName', page).html('Episode: ' + item.EpisodeTitle);
+ } else {
+ $('.itemEpisodeName', page).html('');
+ }
+
+ if (item.CommunityRating) {
+ $('.itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(item)).show();
+ } else {
+ $('.itemCommunityRating', page).hide();
+ }
+
+ $('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
+
+ LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
+ LibraryBrowser.renderOverview($('.itemOverview', page), item);
+ $('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
+
+ if (ApiClient.isWebSocketOpen()) {
+
+ var vals = [item.Type, item.Id, item.Name];
+
+ vals.push('livetv');
+
+ ApiClient.sendWebSocketMessage("Context", vals.join('|'));
+ }
+
+ if (MediaPlayer.canPlay(item)) {
+ $('#playButtonContainer', page).show();
+ } else {
+ $('#playButtonContainer', page).hide();
+ }
+
+ Dashboard.getCurrentUser().done(function (user) {
+
+ if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
+ $('#editButtonContainer', page).show();
+ } else {
+ $('#editButtonContainer', page).hide();
+ }
+
+ });
+
+ Dashboard.hideLoadingMsg();
+ });
+ }
+
+ $(document).on('pageinit', "#liveTvProgramPage", function () {
+
+ var page = this;
+
+ }).on('pageshow', "#liveTvProgramPage", function () {
+
+ var page = this;
+
+ reload(page);
+
+ }).on('pagehide', "#liveTvProgramPage", function () {
+
+ currentItem = null;
+ });
+
+})(jQuery, document, ApiClient);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/livetvrecordings.js b/dashboard-ui/scripts/livetvrecordings.js
index dc31d57456..cb8969031d 100644
--- a/dashboard-ui/scripts/livetvrecordings.js
+++ b/dashboard-ui/scripts/livetvrecordings.js
@@ -59,9 +59,11 @@
html += ' | ' + LiveTvHelpers.getDisplayTime(recording.StartDate) + ' | ';
- var minutes = recording.DurationMs / 60000;
+ var minutes = recording.RunTimeTicks / 600000000;
- html += '' + minutes.toFixed(0) + ' mins | ';
+ minutes = minutes || 1;
+
+ html += '' + Math.round(minutes) + 'min | ';
html += '' + (recording.Status || '') + ' | ';
diff --git a/dashboard-ui/scripts/livetvtimers.js b/dashboard-ui/scripts/livetvtimers.js
index 63b63f82a8..ae9c94f6d1 100644
--- a/dashboard-ui/scripts/livetvtimers.js
+++ b/dashboard-ui/scripts/livetvtimers.js
@@ -74,9 +74,11 @@
html += '' + LiveTvHelpers.getDisplayTime(timer.StartDate) + ' | ';
- var minutes = timer.DurationMs / 60000;
+ var minutes = timer.RunTimeTicks / 600000000;
- html += '' + minutes.toFixed(0) + ' mins | ';
+ minutes = minutes || 1;
+
+ html += '' + Math.round(minutes) + 'min | ';
html += '';
|