mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #839 - Support getting latest channel items
This commit is contained in:
parent
77b267a916
commit
4beb349afe
17 changed files with 239 additions and 19 deletions
40
dashboard-ui/scripts/channelslatest.js
Normal file
40
dashboard-ui/scripts/channelslatest.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
(function ($, document) {
|
||||
|
||||
function reloadItems(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var options = {
|
||||
|
||||
Limit: 30,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed",
|
||||
UserId: Dashboard.getCurrentUserId()
|
||||
};
|
||||
|
||||
$.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: 'auto',
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
context: 'channels',
|
||||
lazy: true
|
||||
});
|
||||
|
||||
$("#items", page).html(html).trigger('create').createPosterItemMenus();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#channelsLatestPage", function () {
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
Loading…
Add table
Add a link
Reference in a new issue