|
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64 User : ServerPC ( 0) PHP Version : 8.2.12 Disable Function : NONE Directory : C:/Users/ServerPC/AppData/Roaming/Emby-Server/system.old/dashboard-ui/home/ |
Upload File : |
define(["exports","./../modules/tabbedview/basetab.js","./../modules/emby-elements/emby-itemscontainer/emby-itemscontainer.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/common/usersettings/usersettings.js","./../modules/layoutmanager.js","./../modules/appheader/appheader.js","./../modules/skinviewmanager.js","./../modules/approuter.js","./../modules/common/globalize.js","./../modules/common/appsettings.js","./../modules/registrationservices/registrationservices.js","./../modules/common/servicelocator.js","./../modules/tabbedview/sectionscontroller.js"],function(_exports,_basetab,_embyItemscontainer,_connectionmanager,_usersettings,_layoutmanager,_appheader,_skinviewmanager,_approuter,_globalize,_appsettings,_registrationservices,_servicelocator,_sectionscontroller){function HomeTab(view,params){_basetab.default.apply(this,arguments),_sectionscontroller.default.apply(this,arguments),this.view=view,this.params=params,this.apiClient=_connectionmanager.default.currentApiClient(),view.classList.add("homeSectionsContainer")}function getAppInfo(apiClient){var cacheKey="lastappinfopresent5",lastDatePresented=parseInt(_appsettings.default.get(cacheKey)||"0");return lastDatePresented?Date.now()-lastDatePresented<1728e5?Promise.resolve([]):_registrationservices.default.validateFeature("dvr",{showDialog:!1,viewOnly:!0}).then(function(){return _appsettings.default.set(cacheKey,Date.now()),[]},function(){return _appsettings.default.set(cacheKey,Date.now()),function(apiClient){var items=[];return items.push({Name:"",Id:"PremiereInfo1",ImageUrl:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png",PrimaryImageAspectRatio:16/9,ServerId:apiClient.serverId()}),items.push({Name:"",Id:"PremiereInfo2",ImageUrl:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png",PrimaryImageAspectRatio:16/9,ServerId:apiClient.serverId()}),items.push({Name:"",Id:"PremiereInfo3",ImageUrl:"https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png",PrimaryImageAspectRatio:16/9,ServerId:apiClient.serverId()}),Promise.resolve({Items:items,TotalRecordCount:items.length})}(apiClient)}):(_appsettings.default.set(cacheKey,Date.now()),Promise.resolve([]))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(HomeTab.prototype,_basetab.default.prototype),Object.assign(HomeTab.prototype,_sectionscontroller.default.prototype),HomeTab.prototype.enablePushDownFocusPreview=function(){return _layoutmanager.default.tv&&_usersettings.default.enableHomescreenFocusPreviews()&&"y"===this.scrollDirection()},HomeTab.prototype.onItemCustomAction=function(options){var _item$Id;if(null==(_item$Id=options.item.Id)||!_item$Id.startsWith("PremiereInfo"))return _sectionscontroller.default.prototype.onItemCustomAction.apply(this,arguments);_registrationservices.default.showPremiereInfo()},HomeTab.prototype.fetchSectionItems=function(query){var instance=this.instance,section=this.section;if(section.Items)return _sectionscontroller.default.prototype.fetchSectionItems.apply(this,arguments);var viewScrollX="x"===instance.scrollDirection(),sectionType=section.SectionType,apiClient=instance.getApiClient();if("appinfo"===sectionType)return getAppInfo(apiClient);var fields=instance.getRequestedItemFields()+",PrimaryImageAspectRatio,ProgramPrimaryImageAspectRatio,ProductionYear",sectionScrollX=!viewScrollX&&"Vertical"!==section.ScrollDirection;switch(section.CollectionType||""){case"":case"tvshows":fields+=",Status,EndDate"}var limit=null;return sectionScrollX||"userviews"!==sectionType&&(limit=16),viewScrollX&&"userviews"!==sectionType&&(limit=12),apiClient.getHomeScreenSectionItems({query:Object.assign({Fields:fields,ImageTypeLimit:1,EnableImageTypes:instance.getRequestedImageTypes(),Limit:limit},query),section:section})},HomeTab.prototype.fetchSections=function(){var instance=this,apiClient=this.getApiClient();return apiClient.getCurrentUser().then(function(user){return function(apiClient,user){return function(apiClient,user){return apiClient.getHomeScreenSections({user:user})}(apiClient,user).then(function(sections){return sections.splice(Math.min(1,sections.length),0,{Id:"appinfo",SectionType:"appinfo",Name:"Discover Emby Premiere",Subtitle:"Enjoy Emby DVR, get free access to Emby apps, and more."}),user.Policy.EnableContentDownloading&&_servicelocator.appHost.supports("sync")&§ions.splice(1,0,{Id:"latestdownloads",SectionType:"latestdownloads",Name:_globalize.default.translate("Downloads")}),sections})}(apiClient,user).then(function(sections){for(var enableFocusPreview=instance.enableFocusPreview(),viewScrollX="x"===instance.scrollDirection(),i=0,length=sections.length;i<length;i++){var section=sections[i],collectionType=section.CollectionType,sectionType=section.SectionType,viewType=section.ViewType||"cards",sectionScrollX=!viewScrollX&&"Vertical"!==section.ScrollDirection;switch("userviews"===sectionType&§ionScrollX&&(section.FinePointerWrap=!0),section.HeaderButtons=[],sectionType){case"onnow":section.Href=_approuter.default.getRouteUrl("livetv",{serverId:apiClient.serverId(),section:"onnow"}),section.ShowLiveTVButtons=!viewScrollX;break;case"latestdownloads":section.Href=_approuter.default.getRouteUrl("downloads"),section.HeaderButtons.push({Name:_globalize.default.translate("HeaderManageDownloads"),Href:_approuter.default.getRouteUrl("managedownloads"),Icon:""})}section.ParentItem&&(section.Href=_approuter.default.getRouteUrl(section.ParentItem,{section:"latestmedia"===sectionType?"latest":null}));var fields=[],lines=null,sectionScrollX="buttons"===viewType||"list"===viewType&§ionScrollX,viewType="buttons"===viewType;if(!enableFocusPreview||sectionScrollX)switch(sectionType){case"activerecordings":fields.push("ParentName"),fields.push("Name"),fields.push("ChannelName"),fields.push("AirTime");break;case"userviews":fields.push("Name");break;case"onnow":fields.push("CurrentProgramName"),fields.push("CurrentProgramParentNameOrName"),fields.push("CurrentProgramTime");break;case"resume":case"downloads":fields.push("Name"),fields.push("ProductionYear"),fields.push("ParentName"),lines=2;break;case"resumeaudio":fields.push("Name"),fields.push("Album"),fields.push("ParentName");break;case"nextup":fields.push("Name"),fields.push("ParentName");break;case"appinfo":break;default:"photos"!==collectionType&&fields.push("Name"),"movies"!==collectionType&&"tvshows"!==collectionType&&"musicvideos"!==collectionType&&collectionType||fields.push("ProductionYear"),"music"!==collectionType&&"audiobooks"!==collectionType&&"tvshows"!==collectionType&&"musicvideos"!==collectionType&&collectionType||fields.push("ParentName"),1<fields.length&&(lines="musicvideos"!==collectionType&&collectionType?2:3)}var preferThumb="auto",preferSeriesImage=void 0;switch(["resume","nextup","activerecordings"].includes(sectionType)?preferThumb=!0:"audiobooks"!==collectionType&&"music"!==collectionType&&"onnow"!==sectionType&&(preferThumb=null),section.ImageType){case"Thumb":preferThumb=!0;break;case"Primary":preferSeriesImage=!(preferThumb=null)}viewType&&fields.length?lines=1:sectionScrollX&&2<fields.length&&(lines=2),section.ListOptions={shape:!0!==preferThumb||preferSeriesImage?"autooverflow":"backdrop",preferThumb:preferThumb,inheritThumb:("auto"!==preferThumb||"audiobooks"===collectionType||"music"===collectionType)&&null,preferSeriesImage:preferSeriesImage,showChildCountIndicator:["latestmedia"].includes(sectionType),context:"home",hoverPlayButton:!["userviews"].includes(sectionType),image:!viewType&&null,sideFooter:sectionScrollX||null,smallSideFooter:viewType||null,fields:fields,showCurrentProgramImage:"onnow"===sectionType,showAirDateTime:"onnow"!==sectionType&&null,defaultShape:"onnow"===sectionType?"portrait":null,action:"onnow"===sectionType?"programlink":"appinfo"===sectionType?"custom":null,multiSelect:!["onnow","appinfo"].includes(sectionType),albumFirst:"resumeaudio"===sectionType,lines:lines,focusTransformTitleAdjust:!0,contextMenu:!["appinfo"].includes(sectionType),hoverMenu:!["appinfo"].includes(sectionType)},section.CommandOptions={createRecording:"onnow"!==sectionType&&null,removeFromResume:["resume","resumeaudio"].includes(sectionType),removeFromNextUp:"nextup"===sectionType}}return sections})})},HomeTab.prototype.onResume=function(options){var serverName;return _skinviewmanager.default.getSkinOptions().showTitleOnHomeTab&&(serverName=_connectionmanager.default.currentApiClient().serverName(),serverName=_globalize.default.translate("Home")+" - "+serverName,_appheader.default.setTitle(serverName)),_basetab.default.prototype.onResume.apply(this,arguments),_sectionscontroller.default.prototype.onResume.apply(this,arguments)},HomeTab.prototype.onPause=function(){_basetab.default.prototype.onPause.apply(this,arguments),_sectionscontroller.default.prototype.onPause.apply(this,arguments)},HomeTab.prototype.destroy=function(){_basetab.default.prototype.destroy.apply(this,arguments),_sectionscontroller.default.prototype.destroy.apply(this,arguments)};_exports.default=HomeTab});