Scenes
diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js
index 7ed0a4d6d4..dcc248aa55 100644
--- a/dashboard-ui/scripts/Itemdetailpage.js
+++ b/dashboard-ui/scripts/Itemdetailpage.js
@@ -164,7 +164,7 @@
$('#scenesCollapsible', page).hide();
} else {
$('#scenesCollapsible', page).show();
- renderScenes(page, item);
+ renderScenes(page, item, 6);
}
if (!item.LocalTrailerCount || item.LocalTrailerCount == 0) {
$('#trailersCollapsible', page).hide();
@@ -176,13 +176,13 @@
$('#specialsCollapsible', page).hide();
} else {
$('#specialsCollapsible', page).show();
- renderSpecials(page, item);
+ renderSpecials(page, item, 6);
}
if (!item.People || !item.People.length) {
$('#castCollapsible', page).hide();
} else {
$('#castCollapsible', page).show();
- renderCast(page, item, context);
+ renderCast(page, item, context, 10);
}
$('#themeSongsCollapsible', page).hide();
@@ -195,6 +195,8 @@
ApiClient.getThemeVideos(Dashboard.getCurrentUserId(), item.Id).done(function (result) {
renderThemeVideos(page, item, result);
});
+
+ renderCriticReviews(page, item, 1);
}
function renderDetails(page, item, context) {
@@ -316,6 +318,97 @@
$('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item));
}
+ function renderCriticReviews(page, item, limit) {
+
+ var options = {};
+
+ if (limit) {
+ options.limit = limit;
+ }
+
+ ApiClient.getCriticReviews(item.Id, options).done(function (result) {
+
+ if (result.TotalRecordCount) {
+ $('#criticReviewsCollapsible', page).show();
+ renderCriticReviewsContent(page, result, limit);
+ } else {
+ $('#criticReviewsCollapsible', page).hide();
+ }
+ });
+ }
+
+ function renderCriticReviewsContent(page, result, limit) {
+
+ var html = '';
+
+ var reviews = result.ItemReviews;
+
+ for (var i = 0, length = reviews.length; i < length; i++) {
+
+ var review = reviews[i];
+
+ html += '
';
+
+ html += '
';
+
+
+ if (review.Score != null) {
+ html += review.Score;
+ }
+ else if (review.Likes != null) {
+
+ if (review.Likes) {
+ html += '

';
+ } else {
+ html += '

';
+ }
+ }
+
+ html += '
';
+
+ html += '
' + review.Caption + '
';
+
+ var vals = [];
+
+ if (review.ReviewerName) {
+ vals.push(review.ReviewerName);
+ }
+ if (review.Publisher) {
+ vals.push(review.Publisher);
+ }
+
+ html += '
' + vals.join(', ') + '.';
+
+ if (review.Date) {
+
+ try {
+
+ var date = parseISO8601Date(review.Date, true).toLocaleDateString();
+
+ html += '' + date + '';
+ }
+ catch (error) {
+
+ }
+
+ }
+
+ html += '
';
+
+ if (review.Url) {
+ html += '
';
+ }
+
+ html += '
';
+ }
+
+ if (limit && result.TotalRecordCount > limit) {
+ html += '
';
+ }
+
+ $('#criticReviewsContent', page).html(html).trigger('create');
+ }
+
function renderThemeSongs(page, item, result) {
if (result.Items.length) {
@@ -336,13 +429,17 @@
}
}
- function renderScenes(page, item) {
+ function renderScenes(page, item, limit) {
var html = '';
- var chapters = item.Chapters || {};
+ var chapters = item.Chapters || [];
for (var i = 0, length = chapters.length; i < length; i++) {
+ if (limit && i >= limit) {
+ break;
+ }
+
var chapter = chapters[i];
var chapterName = chapter.Name || "Chapter " + i;
@@ -374,7 +471,11 @@
html += '';
}
- $('#scenesContent', page).html(html);
+ if (limit && chapters.length > limit) {
+ html += '
';
+ }
+
+ $('#scenesContent', page).html(html).trigger('create');
}
function renderGallery(page, item) {
@@ -479,15 +580,21 @@
$('#mediaInfoContent', page).html(html).trigger('create');
}
- function getVideosHtml(items) {
+ function getVideosHtml(items, limit, moreButtonClass) {
var html = '';
for (var i = 0, length = items.length; i < length; i++) {
+ if (limit && i >= limit) {
+ break;
+ }
+
var item = items[i];
- html += '
';
+ var cssClass = "posterItem smallBackdropPosterItem";
+
+ html += '';
var imageTags = item.ImageTags || {};
@@ -522,14 +629,18 @@
}
+ if (limit && items.length > limit) {
+ html += '';
+ }
+
return html;
}
- function renderSpecials(page, item) {
+ function renderSpecials(page, item, limit) {
ApiClient.getSpecialFeatures(Dashboard.getCurrentUserId(), item.Id).done(function (specials) {
- $('#specialsContent', page).html(getVideosHtml(specials));
+ $('#specialsContent', page).html(getVideosHtml(specials, limit, "moreSpecials")).trigger('create');
});
}
@@ -543,19 +654,59 @@
});
}
- function renderCast(page, item, context) {
+ function renderCast(page, item, context, limit) {
+
var html = '';
var casts = item.People || [];
for (var i = 0, length = casts.length; i < length; i++) {
+ if (limit && i >= limit) {
+ break;
+ }
+
var cast = casts[i];
- html += LibraryBrowser.createCastImage(cast, context);
+ html += '';
+
+ var imgUrl;
+
+ if (cast.PrimaryImageTag) {
+
+ imgUrl = ApiClient.getPersonImageUrl(cast.Name, {
+ width: 130,
+ tag: cast.PrimaryImageTag,
+ type: "primary"
+ });
+
+ } else {
+
+ imgUrl = "css/images/items/list/person.png";
+ }
+
+ html += '';
+
+
+
+ html += '';
+
+ html += '
' + cast.Name + '
';
+
+ var role = cast.Role ? "as " + cast.Role : cast.Type;
+
+ html += '
' + (role || "") + '
';
+
+ html += '
';
+
+ html += '';
}
- $('#castContent', page).html(html);
+ if (limit && casts.length > limit) {
+ html += '
';
+ }
+
+ $('#castContent', page).html(html).trigger('create');
}
function play(startPosition) {
@@ -581,11 +732,33 @@
var page = this;
+ $(page).on("click.moreScenes", ".moreScenes", function () {
+
+ renderScenes(page, currentItem);
+
+ }).on("click.morePeople", ".morePeople", function () {
+
+ renderCast(page, currentItem, getContext(currentItem));
+
+ }).on("click.moreSpecials", ".moreSpecials", function () {
+
+ renderSpecials(page, currentItem);
+
+ }).on("click.moreCriticReviews", ".moreCriticReviews", function () {
+
+ renderCriticReviews(page, currentItem);
+
+ });
+
reload(page);
}).on('pagehide', "#itemDetailPage", function () {
currentItem = null;
+
+ var page = this;
+
+ $(page).off("click.moreScenes").off("click.morePeople").off("click.moreSpecials").off("click.moreCriticReviews");
});
function itemDetailPage() {
diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js
index 20c167a293..0ea92da164 100644
--- a/dashboard-ui/scripts/addpluginpage.js
+++ b/dashboard-ui/scripts/addpluginpage.js
@@ -166,7 +166,7 @@
$('#pViewWebsite', page).hide();
}
- if (pkg.previewImage) {
+ if (pkg.previewImage || pkg.thumbImage) {
var color = pkg.tileColor || "#2572EB";
var img = pkg.previewImage ? pkg.previewImage : pkg.thumbImage;
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index a6d656772c..6205106d71 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -700,51 +700,51 @@
var links = [];
if (item.HomePageUrl) {
- links.push('
Website');
+ links.push('
Website');
}
var providerIds = item.ProviderIds || {};
if (providerIds.Imdb) {
if (item.Type == "Movie" || item.Type == "Episode" || item.Type == "Trailer")
- links.push('
IMDb');
+ links.push('
IMDb');
else if (item.Type == "Person")
- links.push('
IMDb');
+ links.push('
IMDb');
}
if (providerIds.Tmdb) {
if (item.Type == "Movie" || item.Type == "Trailer")
- links.push('
TMDB');
+ links.push('
TMDB');
else if (item.Type == "BoxSet")
- links.push('
TMDB');
+ links.push('
TMDB');
else if (item.Type == "Person")
- links.push('
TMDB');
+ links.push('
TMDB');
}
if (providerIds.Tvdb)
- links.push('
TVDB');
+ links.push('
TVDB');
if (providerIds.Tvcom) {
if (item.Type == "Episode")
- links.push('
TV.com');
+ links.push('
TV.com');
else if (item.Type == "Person")
- links.push('
TV.com');
+ links.push('
TV.com');
}
if (providerIds.Musicbrainz) {
if (item.Type == "MusicArtist" || item.Type == "Artist") {
- links.push('
MusicBrainz');
+ links.push('
MusicBrainz');
} else {
- links.push('
MusicBrainz');
+ links.push('
MusicBrainz');
}
}
if (providerIds.Gamesdb)
- links.push('
GamesDB');
+ links.push('
GamesDB');
if (links.length) {
var html = 'Links: ' + links.join(' / ');
- $(linksElem).html(html);
+ $(linksElem).html(html).trigger('create');
} else {
$(linksElem).hide();
@@ -1272,7 +1272,7 @@
try {
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
- text = (date.getMonth() + 1) + "/" + (date.getDate()) + "/" + date.getFullYear();
+ text = date.toLocaleDateString();
miscInfo.push(text);
}
catch (e) {
@@ -1379,7 +1379,7 @@
html += ' / ';
}
- html += '
' + item.Studios[i].Name + '';
+ html += '
' + item.Studios[i].Name + '';
}
elem.show().html(html).trigger('create');
@@ -1401,7 +1401,7 @@
html += ' / ';
}
- html += '
' + item.Genres[i] + '';
+ html += '
' + item.Genres[i] + '';
}
elem.show().html(html).trigger('create');
@@ -1583,46 +1583,6 @@
}) + '" />';
html += '
';
- return html;
- },
-
- createCastImage: function (cast, context) {
-
- var html = '';
-
- html += '
';
-
return html;
}
diff --git a/packages.config b/packages.config
index be16737802..d1529864bb 100644
--- a/packages.config
+++ b/packages.config
@@ -1,6 +1,6 @@