mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
32 lines
No EOL
753 B
JavaScript
32 lines
No EOL
753 B
JavaScript
(function ($, document, apiClient) {
|
|
|
|
function getChannelsHtml(channels) {
|
|
|
|
return LibraryBrowser.getPosterViewHtml({
|
|
items: channels,
|
|
useAverageAspectRatio: true,
|
|
shape: "backdrop",
|
|
centerText: true
|
|
});
|
|
}
|
|
|
|
function renderChannels(page, channels) {
|
|
|
|
$('#items', page).html(getChannelsHtml(channels)).trigger('create');
|
|
}
|
|
|
|
$(document).on('pagebeforeshow', "#liveTvChannelsPage", function () {
|
|
|
|
var page = this;
|
|
|
|
apiClient.getLiveTvChannels({
|
|
|
|
userId: Dashboard.getCurrentUserId()
|
|
|
|
}).done(function (result) {
|
|
|
|
renderChannels(page, result.Items);
|
|
});
|
|
});
|
|
|
|
})(jQuery, document, ApiClient); |