mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add basic open subtitle configuration
This commit is contained in:
parent
3b5259ce8e
commit
746a467d6a
20 changed files with 420 additions and 241 deletions
|
@ -1,11 +1,118 @@
|
|||
(function ($, document, apiClient) {
|
||||
|
||||
function fillSeriesSpotlight(elem, item, nextUp) {
|
||||
|
||||
var html = '<h1 class="spotlightTitle">' + item.Name + '</h1>';
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
tag: item.BackdropImageTags[0]
|
||||
});
|
||||
|
||||
html += '<div class="spotlight" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
tag: item.ImageTags.Primary,
|
||||
EnableImageEnhancers: false
|
||||
});
|
||||
|
||||
html += '<div class="spotlightContent">';
|
||||
html += '<div class="spotlightPoster" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
|
||||
html += '<div class="spotlightContentInner">';
|
||||
html += '<p>' + LibraryBrowser.getMiscInfoHtml(item) + '</p>';
|
||||
html += '<p>' + (item.Overview || '') + '</p>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
if (nextUp && nextUp.ImageTags && nextUp.ImageTags.Primary) {
|
||||
|
||||
html += '<div class="spotlightContent rightSpotlightContent">';
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(nextUp.Id, {
|
||||
type: "Primary",
|
||||
tag: nextUp.ImageTags.Primary,
|
||||
EnableImageEnhancers: false
|
||||
});
|
||||
|
||||
html += '<div class="spotlightPoster" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
|
||||
html += '<div class="spotlightContentInner">';
|
||||
html += LibraryBrowser.getPosterViewDisplayName(nextUp);
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="spotlightPlaceHolder"></div>';
|
||||
|
||||
$(elem).html(html);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function reloadSpotlight(page, allPromise) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "Random",
|
||||
SortOrder: "Descending",
|
||||
Limit: 1,
|
||||
Recursive: true,
|
||||
IncludeItemTypes: "Series",
|
||||
ImageTypes: "Backdrop,Primary",
|
||||
Fields: "Overview"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
allPromise.done(function () {
|
||||
|
||||
var index = 0;
|
||||
$('.spotlightContainer', page).each(function () {
|
||||
|
||||
var elem = this;
|
||||
var item = result.Items[index];
|
||||
index++;
|
||||
|
||||
if (item && item.Type == 'Series') {
|
||||
|
||||
options = {
|
||||
|
||||
Limit: 1,
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
SeriesId: item.Id
|
||||
};
|
||||
|
||||
ApiClient.getNextUpEpisodes(options).done(function (nextUpResult) {
|
||||
|
||||
fillSeriesSpotlight(elem, item, nextUpResult.Items[0]);
|
||||
});
|
||||
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#indexPage", function () {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.spotlightContainer', page).empty();
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
|
@ -19,7 +126,7 @@
|
|||
ExcludeLocationTypes: "Virtual"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
|
@ -43,7 +150,7 @@
|
|||
|
||||
SortBy: "DateCreated",
|
||||
SortOrder: "Descending",
|
||||
Limit: screenWidth >= 1920 ? 20 : (screenWidth >= 1440 ? 16 : (screenWidth >= 800 ? 12 : 8)),
|
||||
Limit: screenWidth >= 2400 ? 21 : (screenWidth >= 1920 ? 15 : (screenWidth >= 1440 ? 12 : (screenWidth >= 800 ? 12 : 8))),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed,IsNotFolder",
|
||||
|
@ -51,7 +158,7 @@
|
|||
ExcludeLocationTypes: "Virtual,Remote"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
var promise2 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
|
||||
|
@ -63,6 +170,9 @@
|
|||
|
||||
})).createPosterItemMenus();
|
||||
});
|
||||
|
||||
//var allPromise = $.when(promise1, promise2);
|
||||
//reloadSpotlight(page, allPromise);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
Loading…
Add table
Add a link
Reference in a new issue