mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add library to front page
This commit is contained in:
parent
dc6dbcf469
commit
655c9cb48f
11 changed files with 102 additions and 28 deletions
|
@ -32,6 +32,18 @@
|
|||
|
||||
DashboardPage.reloadSystemInfo(page);
|
||||
DashboardPage.reloadNews(page);
|
||||
|
||||
DashboardPage.sessionUpdateTimer = setInterval(DashboardPage.refreshSessionsLocally, 60000);
|
||||
},
|
||||
|
||||
refreshSessionsLocally: function () {
|
||||
|
||||
var list = DashboardPage.sessionsList;
|
||||
|
||||
if (list) {
|
||||
console.log('refreshSessionsLocally');
|
||||
DashboardPage.renderActiveConnections($.mobile.activePage, list);
|
||||
}
|
||||
},
|
||||
|
||||
reloadSystemInfo: function (page) {
|
||||
|
@ -122,6 +134,10 @@
|
|||
|
||||
$(ApiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange);
|
||||
DashboardPage.stopInterval();
|
||||
|
||||
if (DashboardPage.sessionUpdateTimer) {
|
||||
clearInterval(DashboardPage.sessionUpdateTimer);
|
||||
}
|
||||
},
|
||||
|
||||
startInterval: function () {
|
||||
|
@ -190,6 +206,8 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
DashboardPage.sessionsList = sessions;
|
||||
|
||||
var parentElement = $('.activeDevices', page);
|
||||
|
||||
$('.activeSession', parentElement).addClass('deadSession');
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
|
||||
if (nextUp && nextUp.ImageTags && nextUp.ImageTags.Primary) {
|
||||
|
||||
|
||||
html += '<div class="spotlightContent rightSpotlightContent">';
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(nextUp.Id, {
|
||||
|
@ -113,6 +113,24 @@
|
|||
|
||||
var options = {
|
||||
|
||||
SortBy: "SortName",
|
||||
Fields: "PrimaryImageAspectRatio"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('.myLibrary', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: 'smallBackdrop',
|
||||
showTitle: true,
|
||||
centerText: true
|
||||
|
||||
})).createPosterItemMenus();
|
||||
|
||||
});
|
||||
|
||||
options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
MediaTypes: "Video",
|
||||
|
@ -124,7 +142,7 @@
|
|||
ExcludeLocationTypes: "Virtual"
|
||||
};
|
||||
|
||||
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
|
@ -156,7 +174,7 @@
|
|||
ExcludeLocationTypes: "Virtual,Remote"
|
||||
};
|
||||
|
||||
var promise2 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
|
||||
|
@ -168,9 +186,6 @@
|
|||
|
||||
})).createPosterItemMenus();
|
||||
});
|
||||
|
||||
//var allPromise = $.when(promise1, promise2);
|
||||
//reloadSpotlight(page, allPromise);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
clearProgressInterval();
|
||||
|
||||
var intervalTime = ApiClient.isWebSocketOpen() ? 2000 : 20000;
|
||||
var intervalTime = ApiClient.isWebSocketOpen() ? 1200 : 20000;
|
||||
|
||||
currentProgressInterval = setInterval(function () {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
SortBy: "DateCreated",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "MusicAlbum",
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
ParentId: parentId
|
||||
|
@ -36,7 +36,7 @@
|
|||
SortBy: "DateCreated",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo",
|
||||
ParentId: parentId
|
||||
|
@ -59,7 +59,7 @@
|
|||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5),
|
||||
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo",
|
||||
Filters: "IsPlayed",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
if (chapter.ImageTag) {
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(itemId, {
|
||||
maxwidth: 600,
|
||||
width: 800,
|
||||
tag: chapter.ImageTag,
|
||||
type: "Chapter",
|
||||
index: i
|
||||
|
|
|
@ -197,7 +197,7 @@
|
|||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
|
||||
ApiClient.sendWebSocketMessage("SessionsStart", "100,900");
|
||||
ApiClient.sendWebSocketMessage("SessionsStart", "100,800");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 5 : (screenWidth >= 1440 ? 4 : 3),
|
||||
Limit: screenWidth >= 1920 ? 5 : 4,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue