mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
define(["components/categorysyncbuttons","cardBuilder","apphost","imageLoader","emby-itemscontainer"],function(categorysyncbuttons,cardBuilder,appHost,imageLoader){"use strict";function getNextUpPromise(){var query={Limit:24,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:Dashboard.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb"};return ApiClient.getNextUpEpisodes(query)}function loadNextUp(page,promise){promise.then(function(result){result.Items.length?page.querySelector(".noNextUpItems").classList.add("hide"):page.querySelector(".noNextUpItems").classList.remove("hide");var html="",supportsImageAnalysis=appHost.supports("imageanalysis");html+=cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",showTitle:!0,showParentTitle:!0,overlayText:!1,lazy:!0,preferThumb:!0,showDetailsMenu:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!0,context:"home-nextup",cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis});var elem=page.querySelector("#nextUpItems");elem.innerHTML=html,imageLoader.lazyChildren(elem),Dashboard.hideLoadingMsg()})}return function(view,params,tabContent){var nextUpPromise,self=this;categorysyncbuttons.init(view),self.preRender=function(){nextUpPromise=getNextUpPromise()},self.renderTab=function(){Dashboard.showLoadingMsg(),loadNextUp(view,nextUpPromise)}}}); |