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
|
@ -2,7 +2,8 @@
|
|||
|
||||
var query = {
|
||||
|
||||
StartIndex: 0
|
||||
StartIndex: 0,
|
||||
EnableFavoriteSorting: true
|
||||
};
|
||||
|
||||
function getChannelsHtml(channels) {
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
var channelQuery = {
|
||||
|
||||
StartIndex: 0,
|
||||
Limit: 20
|
||||
Limit: 20,
|
||||
EnableFavoriteSorting: true
|
||||
};
|
||||
var channelsPromise;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('PosterCard', 'PosterCard');
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||
|
||||
var currentDate = new Date();
|
||||
currentDate.setHours(0, 0, 0, 0);
|
||||
|
@ -14,7 +14,7 @@
|
|||
};
|
||||
|
||||
function getSavedQueryKey() {
|
||||
return 'livetvitems' + (query.ParentId || '');
|
||||
return 'livetvitems2' + (query.ParentId || '');
|
||||
}
|
||||
|
||||
function updateFilterControls(page) {
|
||||
|
@ -72,8 +72,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
$('.itemsContainer', page).html(html).lazyChildren();
|
||||
|
||||
var elem = $('.itemsContainer', page).html(html).lazyChildren();
|
||||
|
||||
$(pagingHtml).appendTo(elem).trigger('create');
|
||||
|
|
|
@ -58,9 +58,10 @@
|
|||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
overlayText: screenWidth >= 600,
|
||||
coverImage: true
|
||||
coverImage: true,
|
||||
lazy: true
|
||||
|
||||
}));
|
||||
})).lazyChildren();
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
userId: Dashboard.getCurrentUserId(),
|
||||
IsAiring: true,
|
||||
limit: 16
|
||||
limit: 18
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
userId: Dashboard.getCurrentUserId(),
|
||||
IsAiring: false,
|
||||
HasAired: false,
|
||||
limit: 10,
|
||||
limit: 9,
|
||||
IsMovie: false,
|
||||
IsSports: false
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
userId: Dashboard.getCurrentUserId(),
|
||||
IsAiring: false,
|
||||
HasAired: false,
|
||||
limit: 10,
|
||||
limit: 9,
|
||||
IsMovie: true
|
||||
|
||||
}).done(function (result) {
|
||||
|
@ -66,7 +66,7 @@
|
|||
var html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "auto",
|
||||
showTitle: true,
|
||||
showTitle: false,
|
||||
coverImage: true,
|
||||
overlayText: false,
|
||||
lazy: true
|
||||
|
@ -80,7 +80,7 @@
|
|||
userId: Dashboard.getCurrentUserId(),
|
||||
IsAiring: false,
|
||||
HasAired: false,
|
||||
limit: 10,
|
||||
limit: 9,
|
||||
IsSports: true
|
||||
|
||||
}).done(function (result) {
|
||||
|
@ -88,7 +88,7 @@
|
|||
var html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "auto",
|
||||
showTitle: true,
|
||||
showTitle: false,
|
||||
coverImage: true,
|
||||
overlayText: false,
|
||||
lazy: true
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -212,6 +212,9 @@
|
|||
|
||||
supportsPlaylists: function (item) {
|
||||
|
||||
if (item.Type == 'Program') {
|
||||
return false;
|
||||
}
|
||||
return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue