1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added chromecast boilerplate

This commit is contained in:
Luke Pulverenti 2014-02-23 00:52:30 -05:00
parent e5420945f5
commit 3d0e125dd3
17 changed files with 422 additions and 97 deletions

View file

@ -1,39 +1,11 @@
(function ($, document) {
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
function loadResume(page) {
var screenWidth = $(window).width();
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
Limit: screenWidth >= 1920 ? 20 : (screenWidth >= 1440 ? 16 : 15),
Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
Filters: "IsUnplayed",
ExcludeLocationTypes: "Virtual"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
showParentTitle: true,
overlayText: true
})).createPosterItemHoverMenu();
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
@ -59,11 +31,57 @@
showTitle: true,
showParentTitle: true,
overlayText: true
})).createPosterItemHoverMenu();
});
}
function loadNextUp(page) {
var options = {
Limit: 24,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
UserId: Dashboard.getCurrentUserId(),
ExcludeLocationTypes: "Virtual"
};
ApiClient.getNextUpEpisodes(options).done(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
} else {
$('#resumableSection', page).hide();
}
if (result.Items.length) {
$('#nextUpItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
showParentTitle: true,
overlayText: true
})).createPosterItemHoverMenu();
} else {
$('#nextUpItems', page).html('<br/><p>None found. Start watching your shows!</p>');
}
});
}
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
var page = this;
loadResume(page);
loadNextUp(page);
});