mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
live tv updates
This commit is contained in:
parent
16c69c903b
commit
f41b336e87
15 changed files with 196 additions and 101 deletions
|
@ -1,16 +1,12 @@
|
|||
(function ($, document) {
|
||||
|
||||
$(document).on('pagebeforeshow', "#musicRecommendedPage", function () {
|
||||
function loadLatest(page, parentId) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var page = this;
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var options = {
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 20,
|
||||
Limit: 9,
|
||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
|
@ -26,17 +22,22 @@
|
|||
shape: "square",
|
||||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
lazy: true
|
||||
lazy: true,
|
||||
cardLayout: true
|
||||
|
||||
})).lazyChildren();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
options = {
|
||||
function loadRecentlyPlayed(page, parentId) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 10,
|
||||
Limit: 9,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||
Filters: "IsPlayed",
|
||||
|
@ -60,18 +61,23 @@
|
|||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
defaultAction: 'play',
|
||||
lazy: true
|
||||
lazy: true,
|
||||
cardLayout: true
|
||||
|
||||
})).lazyChildren();
|
||||
|
||||
});
|
||||
|
||||
options = {
|
||||
}
|
||||
|
||||
function loadFrequentlyPlayed(page, parentId) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "PlayCount",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 20,
|
||||
Limit: 9,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||
Filters: "IsPlayed",
|
||||
|
@ -95,12 +101,64 @@
|
|||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
defaultAction: 'play',
|
||||
lazy: true
|
||||
lazy: true,
|
||||
cardLayout: true
|
||||
|
||||
})).lazyChildren();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function loadPlaylists(page, parentId) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Playlist",
|
||||
Recursive: true,
|
||||
ParentId: parentId,
|
||||
Fields: "PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete,SyncInfo",
|
||||
StartIndex: 0,
|
||||
Limit: 9
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
var elem;
|
||||
|
||||
if (result.Items.length) {
|
||||
elem = $('#playlists', page).show();
|
||||
} else {
|
||||
elem = $('#playlists', page).hide();
|
||||
}
|
||||
|
||||
$('.itemsContainer', elem).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "square",
|
||||
showTitle: true,
|
||||
lazy: true,
|
||||
coverImage: true,
|
||||
showItemCounts: true,
|
||||
cardLayout: true
|
||||
|
||||
})).lazyChildren();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#musicRecommendedPage", function () {
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var page = this;
|
||||
|
||||
loadLatest(page, parentId);
|
||||
loadPlaylists(page, parentId);
|
||||
loadRecentlyPlayed(page, parentId);
|
||||
loadFrequentlyPlayed(page, parentId);
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue