';
+ html += session.UserName;
}
html += session.AdditionalUsers.map(function (currentSession) {
- return '
' + currentSession.UserName + '';
+ return ', ' + currentSession.UserName;
});
+ html += '
';
+
return html;
},
- updateSession: function (row, session) {
+ updateSession: function (elem, session) {
- row.removeClass('deadSession');
+ elem.removeClass('deadSession');
- $('.username', row).html(DashboardPage.getUsersHtml(session)).trigger('create');
+ $('.sessionItemText', elem).html(DashboardPage.getSessionItemText(session));
var nowPlayingItem = session.NowPlayingItem;
- $('.nowPlayingText', row).html(DashboardPage.getNowPlayingText(session, nowPlayingItem)).trigger('create');
+ if (nowPlayingItem) {
+ $('.posterItemDefaultText', elem).hide();
+ $('.posterItemProgress', elem).show();
+ $('.posterItemName', elem).show().html(nowPlayingItem.Name);
- var imageRow = $('.nowPlayingImage', row);
+ $('progress', elem).val(DashboardPage.getPlaybackProgress(session));
+ } else {
+ $('.posterItemDefaultText', elem).show();
+ $('.posterItemProgress', elem).hide();
+ $('.posterItemName', elem).hide().html('');
+ }
- var image = $('img', imageRow)[0];
+ var imageUrl = DashboardPage.getNowPlayingImage(nowPlayingItem);
- var nowPlayingItemId = nowPlayingItem ? nowPlayingItem.Id : null;
- var nowPlayingItemImageTag = nowPlayingItem ? nowPlayingItem.PrimaryImageTag : null;
+ var image = $('.posterItemImage', elem)[0];
- if (!image || image.getAttribute('data-itemid') != nowPlayingItemId || image.getAttribute('data-tag') != nowPlayingItemImageTag) {
- imageRow.html(DashboardPage.getNowPlayingImage(nowPlayingItem));
+ if (imageUrl && imageUrl != image.getAttribute('data-imageurl')) {
+
+ image.style.backgroundImage = 'url(\'' + imageUrl + '\')';
+ image.setAttribute('data-imageurl', imageUrl);
+
+ } else if (!imageUrl && image.getAttribute('data-imageurl')) {
+
+ image.style.backgroundImage = null;
+ image.setAttribute('data-imageurl', '');
}
},
- getClientType: function (connection) {
+ getSessionItemText: function (connection) {
+
+ var html = '';
+
+ html += '
';
+ html += DashboardPage.getUsersHtml(connection);
+ html += '
';
+
+ //html += '
' + connection.Client + '
';
+ //html += '
' + connection.ApplicationVersion + '
';
+
+ html += '
' + connection.DeviceName + '
';
+
+ return html;
+ },
+
+ getClientImage: function (connection) {
var clientLowered = connection.Client.toLowerCase();
@@ -262,64 +345,76 @@
imgUrl = 'css/images/clients/html5.png';
}
- return "

";
+ return imgUrl;
}
if (clientLowered == "mb-classic") {
- return "

";
+ return "css/images/clients/mbc.png";
}
if (clientLowered == "media browser theater") {
- return "

";
+ return "css/images/clients/mb.png";
}
if (clientLowered == "android") {
- return "

";
+ return "css/images/clients/android.png";
}
if (clientLowered == "roku") {
- return "

";
+ return "css/images/clients/roku.jpg";
}
if (clientLowered == "ios") {
- return "

";
+ return "css/images/clients/ios.png";
}
if (clientLowered == "windows rt") {
- return "

";
+ return "css/images/clients/windowsrt.png";
}
if (clientLowered == "windows phone") {
- return "

";
+ return "css/images/clients/windowsphone.png";
}
if (clientLowered == "dlna") {
- return "

";
+ return "css/images/clients/dlna.png";
}
if (clientLowered == "mbkinect") {
- return "

";
+ return "css/images/clients/mbkinect.png";
}
if (clientLowered == "xbmc") {
- return "

";
+ return "css/images/clients/xbmc.png";
}
- return connection.Client;
+ return "css/images/clients/mb.png";
},
getNowPlayingImage: function (item) {
+ if (item && item.ThumbItemId) {
+ return ApiClient.getImageUrl(item.ThumbItemId, {
+ type: "Thumb",
+ height: 300,
+ tag: item.ThumbImageTag
+ });
+ }
+
+ if (item && item.BackdropItemId) {
+ return ApiClient.getImageUrl(item.BackdropItemId, {
+ type: "Backdrop",
+ height: 300,
+ tag: item.BackdropImageTag
+ });
+ }
+
if (item && item.PrimaryImageTag) {
- var url = ApiClient.getImageUrl(item.Id, {
+ return ApiClient.getImageUrl(item.Id, {
type: "Primary",
- height: 100,
+ height: 300,
tag: item.PrimaryImageTag
});
-
- url += "&xxx=" + new Date().getTime();
-
- return "

";
}
return "";
@@ -422,9 +517,9 @@
DashboardPage.renderPluginUpdateInfo(page, dashboardInfo);
DashboardPage.renderPendingInstallations(page, dashboardInfo.SystemInfo);
},
-
+
renderUrls: function (page, systemInfo) {
-
+
var url = ApiClient.serverAddress() + "/mediabrowser";
$('#bookmarkUrl', page).html(url).attr("href", url);
diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js
index f4d7fcd760..862fcbd35b 100644
--- a/dashboard-ui/scripts/episodes.js
+++ b/dashboard-ui/scripts/episodes.js
@@ -7,7 +7,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "Episode",
Recursive: true,
- Fields: "DateCreated,SeriesInfo,PrimaryImageAspectRatio",
+ Fields: "SeriesInfo,PrimaryImageAspectRatio",
StartIndex: 0,
IsMissing: false,
IsVirtualUnaired: false
diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js
index c9a058a37a..24903bd467 100644
--- a/dashboard-ui/scripts/itembynamedetailpage.js
+++ b/dashboard-ui/scripts/itembynamedetailpage.js
@@ -396,7 +396,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "",
Recursive: true,
- Fields: "DateCreated,AudioInfo,SeriesInfo,ParentId,PrimaryImageAspectRatio",
+ Fields: "AudioInfo,SeriesInfo,ParentId,PrimaryImageAspectRatio",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index a6b54ae506..e4c90f9025 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -353,7 +353,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), {
Ids: item.SoundtrackIds.join(","),
- ItemFields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,AudioInfo",
+ ItemFields: "PrimaryImageAspectRatio,ItemCounts,AudioInfo",
SortBy: "SortName"
}).done(function (result) {
@@ -432,7 +432,7 @@
var options = {
userId: Dashboard.getCurrentUserId(),
limit: item.Type == "MusicAlbum" ? 4 : 5,
- fields: "PrimaryImageAspectRatio,DateCreated,UserData"
+ fields: "PrimaryImageAspectRatio,UserData"
};
if (item.Type == "Movie") {
@@ -534,7 +534,7 @@
function renderChildren(page, item, user) {
- var fields = "ItemCounts,DateCreated,AudioInfo,PrimaryImageAspectRatio";
+ var fields = "ItemCounts,AudioInfo,PrimaryImageAspectRatio";
var query = {
ParentId: item.Id,
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index 20dbd48c65..6ac1623634 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -92,10 +92,6 @@
html += '';
}
- if (counts.MovieCount || counts.SeriesCount || counts.SongCount || counts.GameCount) {
- html += '';
- }
-
$('.viewMenuRemoteControlButton', page).before(html);
}
@@ -133,6 +129,7 @@
html += getCollapsibleHtml('Movies', [
{ text: 'Suggested', href: 'moviesrecommended.html' },
+ { text: 'Latest', href: 'movieslatest.html' },
{ text: 'Movies', href: 'movies.html' },
{ text: 'Collections', href: 'collections.html' },
{ text: 'Trailers', href: 'movietrailers.html' },
diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js
index 0b8e230ea0..cb065e1e93 100644
--- a/dashboard-ui/scripts/moviecollections.js
+++ b/dashboard-ui/scripts/moviecollections.js
@@ -7,7 +7,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "BoxSet",
Recursive: true,
- Fields: "DateCreated,PrimaryImageAspectRatio",
+ Fields: "PrimaryImageAspectRatio",
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js
index 69ae53e56d..4cb13540e9 100644
--- a/dashboard-ui/scripts/movies.js
+++ b/dashboard-ui/scripts/movies.js
@@ -9,7 +9,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "Movie",
Recursive: true,
- Fields: "DateCreated,PrimaryImageAspectRatio",
+ Fields: "PrimaryImageAspectRatio",
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/movieslatest.js b/dashboard-ui/scripts/movieslatest.js
new file mode 100644
index 0000000000..b2a0ed827d
--- /dev/null
+++ b/dashboard-ui/scripts/movieslatest.js
@@ -0,0 +1,60 @@
+(function ($, document) {
+
+ $(document).on('pagebeforeshow', "#moviesLatestPage", function () {
+
+ var screenWidth = $(window).width();
+
+ var page = this;
+
+ var options = {
+
+ SortBy: "DateCreated",
+ SortOrder: "Descending",
+ IncludeItemTypes: "Movie",
+ Limit: screenWidth >= 1920 ? 32 : (screenWidth >= 1440 ? 24 : (screenWidth >= 800 ? 18 : 12)),
+ Recursive: true,
+ Fields: "PrimaryImageAspectRatio",
+ Filters: "IsUnplayed"
+ };
+
+ ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+
+ $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ useAverageAspectRatio: true
+
+ })).createPosterItemHoverMenu();
+ });
+
+
+ options = {
+
+ SortBy: "DateCreated",
+ SortOrder: "Descending",
+ IncludeItemTypes: "Trailer",
+ Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
+ Recursive: true,
+ Fields: "PrimaryImageAspectRatio",
+ Filters: "IsUnplayed"
+ };
+
+ ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+
+ if (result.Items.length) {
+ $('#trailerSection', page).show();
+ } else {
+ $('#trailerSection', page).hide();
+ }
+
+ $('#trailerItems', page).html(LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ useAverageAspectRatio: true
+
+ })).createPosterItemHoverMenu();
+
+ });
+
+ });
+
+
+})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js
index 99d6ad1e06..8fee981033 100644
--- a/dashboard-ui/scripts/moviesrecommended.js
+++ b/dashboard-ui/scripts/moviesrecommended.js
@@ -1,5 +1,41 @@
(function ($, document) {
+ function getRecommendationHtml(recommendation) {
+
+ var html = '';
+
+ var title = '';
+
+ switch (recommendation.RecommendationType) {
+
+ case 'SimilarToRecentlyPlayed':
+ title = 'Because you watched ' + recommendation.BaselineItemName;
+ break;
+ case 'SimilarToLikedItem':
+ title = 'Because you like ' + recommendation.BaselineItemName;
+ break;
+ case 'HasDirectorFromRecentlyPlayed':
+ case 'HasLikedDirector':
+ title = 'Directed by ' + recommendation.BaselineItemName;
+ break;
+ case 'HasActorFromRecentlyPlayed':
+ case 'HasLikedActor':
+ title = 'Starring ' + recommendation.BaselineItemName;
+ break;
+ }
+
+ html += '';
+
+ html += '
';
+ html += LibraryBrowser.getPosterViewHtml({
+ items: recommendation.Items,
+ useAverageAspectRatio: true
+ });
+ html += '
';
+
+ return html;
+ }
+
$(document).on('pagebeforeshow', "#moviesRecommendedPage", function () {
var screenWidth = $(window).width();
@@ -8,34 +44,13 @@
var options = {
- SortBy: "DateCreated",
- SortOrder: "Descending",
- IncludeItemTypes: "Movie",
- Limit: screenWidth >= 1920 ? 24 : (screenWidth >= 1440 ? 16 : 12),
- Recursive: true,
- Fields: "PrimaryImageAspectRatio,DateCreated,UserData",
- Filters: "IsUnplayed"
- };
-
- ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
-
- $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- useAverageAspectRatio: true
-
- })).createPosterItemHoverMenu();
- });
-
-
- options = {
-
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 4 : (screenWidth >= 1440 ? 4 : 3),
Recursive: true,
- Fields: "DateCreated,UserData"
+ Fields: "PrimaryImageAspectRatio"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
@@ -57,33 +72,26 @@
});
- options = {
-
- SortBy: "DateCreated",
- SortOrder: "Descending",
- IncludeItemTypes: "Trailer",
- Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
- Recursive: true,
- Fields: "PrimaryImageAspectRatio,DateCreated,UserData",
- Filters: "IsUnplayed"
- };
-
- ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
-
- if (result.Items.length) {
- $('#trailerSection', page).show();
- } else {
- $('#trailerSection', page).hide();
- }
-
- $('#trailerItems', page).html(LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- useAverageAspectRatio: true
-
- })).createPosterItemHoverMenu();
-
+ var url = ApiClient.getUrl("Movies/Recommendations", {
+
+ userId: Dashboard.getCurrentUserId(),
+ categoryLimit: screenWidth >= 1200 ? 6 : 3,
+ itemLimit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
+ Fields: "PrimaryImageAspectRatio"
});
+ $.getJSON(url).done(function(recommendations) {
+
+ if (!recommendations.length) {
+
+ $('.recommendations', page).html('
No movie suggestions are currently available. Start watching and rating your movies, and then come back to view your recommendations.
');
+ return;
+ }
+
+ var html = recommendations.map(getRecommendationHtml).join('');
+
+ $('.recommendations', page).html(html).createPosterItemHoverMenu();
+ });
});
diff --git a/dashboard-ui/scripts/movietrailers.js b/dashboard-ui/scripts/movietrailers.js
index 978d3f4839..9f10aea207 100644
--- a/dashboard-ui/scripts/movietrailers.js
+++ b/dashboard-ui/scripts/movietrailers.js
@@ -7,7 +7,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "Trailer",
Recursive: true,
- Fields: "DateCreated,PrimaryImageAspectRatio",
+ Fields: "PrimaryImageAspectRatio",
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js
index 54b353b97f..5cefbfc1e9 100644
--- a/dashboard-ui/scripts/musicalbums.js
+++ b/dashboard-ui/scripts/musicalbums.js
@@ -9,7 +9,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "MusicAlbum",
Recursive: true,
- Fields: "DateCreated,PrimaryImageAspectRatio",
+ Fields: "PrimaryImageAspectRatio",
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/songs.js b/dashboard-ui/scripts/songs.js
index a3b64e01c9..774ab87f16 100644
--- a/dashboard-ui/scripts/songs.js
+++ b/dashboard-ui/scripts/songs.js
@@ -9,7 +9,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "Audio",
Recursive: true,
- Fields: "DateCreated,AudioInfo,ParentId",
+ Fields: "AudioInfo,ParentId",
Limit: 200,
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js
index 605c548684..aaa75b4d2e 100644
--- a/dashboard-ui/scripts/tvshows.js
+++ b/dashboard-ui/scripts/tvshows.js
@@ -9,7 +9,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "Series",
Recursive: true,
- Fields: "SeriesInfo,DateCreated,PrimaryImageAspectRatio",
+ Fields: "SeriesInfo,PrimaryImageAspectRatio",
StartIndex: 0
};