1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/livetvchannels.js

32 lines
753 B
JavaScript
Raw Normal View History

2013-11-20 16:08:12 -05:00
(function ($, document, apiClient) {
function getChannelsHtml(channels) {
return LibraryBrowser.getPosterViewHtml({
items: channels,
useAverageAspectRatio: true,
shape: "backdrop",
centerText: true
});
2013-11-20 16:08:12 -05:00
}
function renderChannels(page, channels) {
$('#items', page).html(getChannelsHtml(channels)).trigger('create');
}
$(document).on('pagebeforeshow', "#liveTvChannelsPage", function () {
var page = this;
2013-11-25 21:53:48 -05:00
apiClient.getLiveTvChannels({
userId: Dashboard.getCurrentUserId()
}).done(function (result) {
2013-11-20 16:08:12 -05:00
2013-11-25 15:39:23 -05:00
renderChannels(page, result.Items);
2013-11-20 16:08:12 -05:00
});
});
})(jQuery, document, ApiClient);