${TabSuggested}
${TabSongs}
diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js
new file mode 100644
index 0000000000..b41cfaa532
--- /dev/null
+++ b/dashboard-ui/scripts/backdrops.js
@@ -0,0 +1,106 @@
+(function ($, document) {
+
+ function getElement() {
+
+ var elem = $('.backdropContainer');
+
+ if (!elem.length) {
+
+ elem = $('
').prependTo(document.body);
+ }
+
+ return elem;
+ }
+
+ function getRandom(min, max) {
+ return Math.floor(Math.random() * (max - min) + min);
+ }
+
+ function getBackdropItemIds(userId, types, parentId) {
+
+ var key = 'backdrops_' + userId + (types || '') + (parentId || '');
+
+ var deferred = $.Deferred();
+
+ var data = localStorage.getItem(key);
+
+ if (data) {
+
+ console.log('Found backdrop id list in cache. Key: ' + key)
+ data = JSON.parse(data);
+ deferred.resolveWith(null, [data]);
+ } else {
+
+ var options = {
+
+ SortBy: "Random",
+ Limit: 50,
+ Recursive: true,
+ IncludeItemTypes: types,
+ ImageTypes: "Backdrop",
+ //Ids: "8114409aa00a2722456c08e298f90bed",
+ ParentId: parentId
+ };
+
+ ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+
+ var images = result.Items.map(function (i) {
+ return {
+ id: i.Id,
+ tag: i.BackdropImageTags[0]
+ };
+ });
+
+ localStorage.setItem(key, JSON.stringify(images));
+ deferred.resolveWith(null, [images]);
+ });
+ }
+
+ return deferred.promise();
+ }
+
+ function showBackdrop(type) {
+
+ getBackdropItemIds(Dashboard.getCurrentUserId(), type, LibraryMenu.getTopParentId()).done(function (images) {
+
+ if (images.length) {
+
+ var index = getRandom(0, images.length - 1);
+ var item = images[index];
+
+ var imgUrl = ApiClient.getImageUrl(item.id, {
+ type: "Backdrop",
+ tag: item.tag
+ });
+
+ getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
+
+ } else {
+
+ clearBackdrop();
+ }
+ });
+ }
+
+ function clearBackdrop() {
+
+ $('.backdropContainer').css('backgroundImage', '');
+ }
+
+ $(document).on('pagebeforeshow', ".backdropPage", function () {
+
+ var page = this;
+
+ // Gets real messy and jumps around the page when scrolling
+ // Can be reviewed later.
+ if ($.browser.msie) {
+ $(page).removeClass('backdropPage');
+ } else {
+ var type = page.getAttribute('data-backdroptype');
+
+ showBackdrop(type);
+ }
+
+ });
+
+})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index df334d5e79..0eda1433c9 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -184,6 +184,14 @@
$('#movieTabs', page).show();
}
+ if (item.Type == "ChannelVideoItem" || item.Type == "ChannelAudioItem" || item.Type == "ChannelCategoryItem") {
+ $('#channelTabs', page).show();
+ }
+
+ if (item.Type == "BoxSet") {
+ $('#boxsetTabs', page).show();
+ }
+
if (item.MediaType == "Game") {
$('#gameTabs', page).show();
}
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 681e5df543..82ea50ae3e 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -704,7 +704,7 @@
html += '
';
var style = "";
- options.lazy = false;
+
if (imgUrl && !options.lazy) {
style += 'background-image:url(\'' + imgUrl + '\');';
}
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index 9395f7a6f4..2fe00c72d8 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -18,22 +18,30 @@
var html = '';
@@ -68,9 +70,9 @@
return LibraryBrowser.getHref(item);
}
-
+
function getViewsHtml(user, counts, items, liveTvInfo) {
-
+
var html = '';
html += items.map(function (i) {
@@ -98,7 +100,8 @@
if (user.Configuration.IsAdministrator) {
html += '';
- html += '';
+ html += '';
+ html += '';
}
return html;
@@ -149,7 +152,7 @@
}
updateLibraryNavLinks(page);
-
+
return panel;
}
@@ -178,7 +181,7 @@
}
}
- function updateLibraryNavLinks(page) {
+ function updateLibraryNavLinks(page, updateElements) {
page = $(page);
@@ -236,22 +239,22 @@
});
- }).on('pagebeforeshow', ".page", function () {
+ }).on('pagebeforeshow', ".libraryPage", function () {
var page = this;
- if ($(page).hasClass('libraryPage')) {
+ updateLibraryNavLinks(page);
- if (!$('.viewMenuBar', page).length) {
+ if (!$('.viewMenuBar', page).length) {
- Dashboard.getCurrentUser().done(function (user) {
+ Dashboard.getCurrentUser().done(function (user) {
- renderHeader(page, user);
-
- updateLibraryNavLinks(page);
- });
- }
+ renderHeader(page, user);
+ updateCastIcon();
+
+ updateLibraryNavLinks(page);
+ });
}
}).on('pageshow', ".libraryPage", function () {
diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js
index 24b40dcf3b..7b15f408e4 100644
--- a/dashboard-ui/scripts/moviesrecommended.js
+++ b/dashboard-ui/scripts/moviesrecommended.js
@@ -5,9 +5,9 @@
var html = '';
var title = '';
-
+
switch (recommendation.RecommendationType) {
-
+
case 'SimilarToRecentlyPlayed':
title = 'Because you watched ' + recommendation.BaselineItemName;
break;
@@ -23,7 +23,7 @@
title = 'Starring ' + recommendation.BaselineItemName;
break;
}
-
+
html += '';
html += '
';
@@ -34,7 +34,7 @@
return html;
}
-
+
$(document).on('pagebeforeshow', "#moviesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
@@ -42,7 +42,7 @@
var screenWidth = $(window).width();
var page = this;
-
+
var options = {
SortBy: "DatePlayed",
@@ -63,20 +63,20 @@
} else {
$('#resumableSection', page).hide();
}
-
+
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
preferBackdrop: true,
shape: 'backdrop',
overlayText: screenWidth >= 600,
showTitle: true
-
+
})).createPosterItemMenus();
});
var url = ApiClient.getUrl("Movies/Recommendations", {
-
+
userId: Dashboard.getCurrentUserId(),
categoryLimit: screenWidth >= 1200 ? 6 : 3,
itemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6),
@@ -84,7 +84,7 @@
ParentId: parentId
});
- $.getJSON(url).done(function(recommendations) {
+ $.getJSON(url).done(function (recommendations) {
if (!recommendations.length) {
@@ -96,6 +96,7 @@
$('.recommendations', page).html(html).createPosterItemMenus();
});
+
});
diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js
index 2a4961ccad..2f218a6c54 100644
--- a/dashboard-ui/scripts/musicrecommended.js
+++ b/dashboard-ui/scripts/musicrecommended.js
@@ -13,7 +13,7 @@
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "MusicAlbum",
- Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 7 : 5),
+ Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
Recursive: true,
Fields: "PrimaryImageAspectRatio",
ParentId: parentId
@@ -36,7 +36,7 @@
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Audio",
- Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 7 : 5),
+ Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo",
ParentId: parentId
@@ -59,7 +59,7 @@
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Audio",
- Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 7 : 5),
+ Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo",
Filters: "IsPlayed",
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 776df0f794..e13d8b8849 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1175,6 +1175,8 @@ var Dashboard = {
getDisplayTime: function (ticks) {
var ticksPerHour = 36000000000;
+ var ticksPerMinute = 600000000;
+ var ticksPerSecond = 10000000;
var parts = [];
@@ -1187,8 +1189,6 @@ var Dashboard = {
ticks -= (hours * ticksPerHour);
- var ticksPerMinute = 600000000;
-
var minutes = ticks / ticksPerMinute;
minutes = Math.floor(minutes);
@@ -1199,10 +1199,8 @@ var Dashboard = {
}
parts.push(minutes);
- var ticksPerSecond = 10000000;
-
var seconds = ticks / ticksPerSecond;
- seconds = Math.round(seconds);
+ seconds = Math.floor(seconds);
if (seconds < 10) {
seconds = '0' + seconds;
diff --git a/dashboard-ui/thirdparty/jquery.unveil-custom.js b/dashboard-ui/thirdparty/jquery.unveil-custom.js
index 79f275a309..648fe06edd 100644
--- a/dashboard-ui/thirdparty/jquery.unveil-custom.js
+++ b/dashboard-ui/thirdparty/jquery.unveil-custom.js
@@ -29,6 +29,7 @@
} else {
this.setAttribute("src", source);
}
+ this.setAttribute("data-src", '');
if (typeof callback === "function") callback.call(this);
}
});
diff --git a/dashboard-ui/tvlatest.html b/dashboard-ui/tvlatest.html
index abef6d884b..483d19eeb3 100644
--- a/dashboard-ui/tvlatest.html
+++ b/dashboard-ui/tvlatest.html
@@ -4,7 +4,7 @@
${TitleMediaBrowser}
-
+
${TabSuggested}
${TabLatest}
diff --git a/dashboard-ui/tvrecommended.html b/dashboard-ui/tvrecommended.html
index 2dd4a28076..e0975f8c4e 100644
--- a/dashboard-ui/tvrecommended.html
+++ b/dashboard-ui/tvrecommended.html
@@ -4,7 +4,7 @@
${TitleMediaBrowser}
-
+
${TabSuggested}
${TabLatest}
diff --git a/dashboard-ui/tvupcoming.html b/dashboard-ui/tvupcoming.html
index 1fc141e300..e2b9aba9a3 100644
--- a/dashboard-ui/tvupcoming.html
+++ b/dashboard-ui/tvupcoming.html
@@ -4,7 +4,7 @@
${TitleMediaBrowser}
-