diff --git a/dashboard-ui/css/images/items/list/collection.png b/dashboard-ui/css/images/items/list/collection.png index d1e862a694..afcebcf64f 100644 Binary files a/dashboard-ui/css/images/items/list/collection.png and b/dashboard-ui/css/images/items/list/collection.png differ diff --git a/dashboard-ui/livetvrecordings.html b/dashboard-ui/livetvrecordings.html index 5e61d0ebec..dc1cf1545e 100644 --- a/dashboard-ui/livetvrecordings.html +++ b/dashboard-ui/livetvrecordings.html @@ -13,9 +13,17 @@ Series
-
-

Recording Groups

-
+
+ + +
+
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index d419a4667f..218b47fb55 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,6 +1,6 @@ var LibraryBrowser = (function (window, document, $, screen, localStorage) { - var defaultBackground = "#555;"; + var defaultBackground = "#444"; return { @@ -590,6 +590,9 @@ if (item.Type == "Person") { return "itembynamedetails.html?person=" + ApiClient.encodeName(item.Name) + "&context=" + itemByNameContext; } + if (item.Type == "Recording") { + return "livetvrecording.html?id=" + id; + } if (item.Type == "MusicArtist") { if (itemByNameContext == "music") { @@ -745,12 +748,22 @@ height = 400; width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null; - imgUrl = ApiClient.getImageUrl(item.Id, { - type: "Primary", - height: height, - width: width, - tag: item.ImageTags.Primary - }); + if (item.Type == "Recording") { + imgUrl = ApiClient.getUrl("LiveTV/Recordings/" + item.Id + "/Images/Primary", { + type: "Primary", + height: height, + width: width, + tag: item.ImageTags.Primary + }); + + } else { + imgUrl = ApiClient.getImageUrl(item.Id, { + type: "Primary", + height: height, + width: width, + tag: item.ImageTags.Primary + }); + } } else if (item.AlbumId && item.AlbumPrimaryImageTag) { @@ -807,16 +820,24 @@ imgUrl = 'css/images/items/list/audio.png'; background = defaultBackground; } else { - background = '#555'; + background = defaultBackground; } } + else if (item.Type == "Recording" || item.Type == "Program") { + + if (item.Name && options.showTitle) { + imgUrl = 'css/images/items/list/collection.png'; + } + + background = defaultBackground; + } else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") { if (item.Name && options.showTitle) { imgUrl = 'css/images/items/list/video.png'; background = defaultBackground; } else { - background = '#555'; + background = defaultBackground; } } else { @@ -824,7 +845,7 @@ imgUrl = 'css/images/items/list/collection.png'; background = LibraryBrowser.getMetroColor(item.Id); } else { - background = '#555'; + background = defaultBackground; } } @@ -874,7 +895,7 @@ if (options.showParentTitle) { html += "
"; - html += item.SeriesName || item.Album || item.AlbumArtist || " "; + html += item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || " "); html += "
"; } @@ -965,7 +986,7 @@ var day = weekday[date.getDay()]; date = date.toLocaleDateString(); - + if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) { return day + " " + date; } @@ -1010,7 +1031,7 @@ getPosterViewDisplayName: function (item, displayAsSpecial) { - var name = item.Name; + var name = item.EpisodeTitle || item.Name; if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) { @@ -1066,7 +1087,7 @@ } return '
Missing
'; }, - + getUnplayedIndicatorHtml: function (item) { if (item.LocationType == 'Virtual') { diff --git a/dashboard-ui/scripts/livetvrecordings.js b/dashboard-ui/scripts/livetvrecordings.js index 47e2ea5be5..282f9b33df 100644 --- a/dashboard-ui/scripts/livetvrecordings.js +++ b/dashboard-ui/scripts/livetvrecordings.js @@ -18,7 +18,7 @@ }); } - + function loadRecordings(page, elem, groupId) { var contentElem = $('.recordingList', elem).html('
'); @@ -39,7 +39,7 @@ var html = ''; - html += '
'; + html += '
'; html += '

' + group.Name + '

'; @@ -53,6 +53,12 @@ function renderRecordingGroups(page, groups) { + if (groups.length) { + $('#recordingGroups', page).show(); + } else { + $('#recordingGroups', page).hide(); + } + var html = ''; for (var i = 0, length = groups.length; i < length; i++) { @@ -60,7 +66,7 @@ html += getRecordingGroupHtml(groups[i]); } - var elem = $('#items', page).html(html).trigger('create'); + var elem = $('#recordingGroupItems', page).html(html).trigger('create'); $('.recordingGroupCollapsible', elem).on('collapsibleexpand.lazyload', function () { @@ -133,6 +139,25 @@ Dashboard.hideLoadingMsg(); } + + function renderLatestRecordings(page, recordings) { + + if (recordings.length) { + $('#latestRecordings', page).show(); + } else { + $('#latestRecordings', page).hide(); + } + + $('#latestRecordingItems', page).html(LibraryBrowser.getPosterViewHtml({ + items: recordings, + useAverageAspectRatio: true, + shape: "smallBackdrop", + showTitle: true, + showParentTitle: true, + overlayText: true + + })); + } function reload(page) { @@ -147,6 +172,17 @@ renderRecordingGroups(page, result.Items); }); + + apiClient.getLiveTvRecordings({ + + userId: Dashboard.getCurrentUserId(), + limit: 6 + + }).done(function (result) { + + renderLatestRecordings(page, result.Items); + + }); } $(document).on('pagebeforeshow', "#liveTvRecordingsPage", function () {