KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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/dashboard-ui/list/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : C:/Users/ServerPC/AppData/Roaming/Emby-Server/system/dashboard-ui/list/list.js
define(["exports","./../modules/emby-apiclient/connectionmanager.js","./../modules/emby-apiclient/events.js","./../modules/common/globalize.js","./../modules/common/playback/playbackmanager.js","./../modules/appheader/appheader.js","./../modules/backdrop/backdrop.js","./../modules/common/itemmanager/itemmanager.js","./../modules/layoutmanager.js","./../modules/common/usersettings/usersettings.js","./../modules/viewmanager/baseview.js","./../search/searchfields.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-elements/emby-tabs/emby-tabs.js","./../modules/emby-elements/emby-itemscontainer/emby-itemscontainer.js","./../modules/tabbedview/listcontroller.js"],function(_exports,_connectionmanager,_events,_globalize,_playbackmanager,_appheader,_backdrop,_itemmanager,_layoutmanager,_usersettings,_baseview,_searchfields,_embyScroller,_embyTabs,_embyItemscontainer,_listcontroller){function hideOrShowAll(elems,hide){for(var i=0,length=elems.length;i<length;i++)hide?elems[i].classList.add("hide"):elems[i].classList.remove("hide")}function ItemsView(view,params){_baseview.default.apply(this,arguments),_listcontroller.default.apply(this,arguments);var _document$querySelect;this.params=params,null==this.supportsViewSettings&&(this.supportsViewSettings="downloads"!==params.parentId&&"search"!==params.type),null==this.enableTotalRecordCountDisplay&&(this.enableTotalRecordCountDisplay="search"!==params.type),this.initItemsContainer(),params.parentId?this.itemsContainer.setAttribute("data-parentid",params.parentId):"nextup"===params.type?this.itemsContainer.setAttribute("data-monitor","videoplayback"):"Program"!==params.type&&"OnNow"!==params.type&&"TvChannel"!==params.type||this.itemsContainer.setAttribute("data-refreshinterval","300000"),"search"===params.type&&(view.querySelector(".searchContainer").classList.remove("hide"),_document$querySelect=_layoutmanager.default.tv?null:null==(_document$querySelect=document.querySelector(".txtNavDrawerSearch "))?void 0:_document$querySelect.value,_document$querySelect=params.query||_document$querySelect,this.searchFields=new _searchfields.default({element:view.querySelector(".searchFields"),serverId:this.serverId(),value:_document$querySelect,autoFocus:!_document$querySelect}),_events.default.on(this.searchFields,"search",function(e,value){var activeSearchTab=this.view.querySelector(".emby-searchable-tab-button.emby-tab-button-active");activeSearchTab&&activeSearchTab.classList.remove("emby-searchable-tab-button"),this.itemsContainer.refreshItems()}.bind(this))),this.initButtons()}function dispatchItemShowEvent(view,eventName,item){view.dispatchEvent(new CustomEvent(eventName,{detail:{item:item},bubbles:!0,cancelable:!1}))}function getTopLevelDownloadFolders(apiClient){return apiClient.getLocalFolders()}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(ItemsView.prototype,_baseview.default.prototype),Object.assign(ItemsView.prototype,_listcontroller.default.prototype),ItemsView.prototype.getFocusContainerElement=function(){var _this$scroller;return(null==(_this$scroller=this.scroller)?void 0:_this$scroller.querySelector(".scrollSlider"))||_baseview.default.prototype.getFocusContainerElement.apply(this,arguments)},ItemsView.prototype.onInputCommand=function(e){switch(e.detail.command){case"refresh":return this.itemsContainer.refreshItems(),e.preventDefault(),void e.stopPropagation();case"search":var _e$detail$originalEve;if(this.searchFields)return null!=(_e$detail$originalEve=e.detail.originalEvent)&&_e$detail$originalEve.target.closest(".navDrawerSearchForm")?this.searchFields.setSearchTerm((null==(_e$detail$originalEve=e.detail.commandOptions)?void 0:_e$detail$originalEve.value)||""):(console.log("focusing search fields"),this.searchFields.focus()),e.preventDefault(),void e.stopPropagation()}_baseview.default.prototype.onInputCommand.apply(this,arguments)},ItemsView.prototype.getTitle=function(){var params=this.params;return"search"===params.type?_globalize.default.translate("Search"):"downloads"===params.parentId?_globalize.default.translate("Downloads"):"Recordings"===params.type?_globalize.default.translate("Recordings"):"OnNow"===params.type?_globalize.default.translate("HeaderOnNow"):"Program"===params.type?"true"===params.IsMovie?_globalize.default.translate("Movies"):"true"===params.IsSports?_globalize.default.translate("Sports"):"true"===params.IsKids?_globalize.default.translate("HeaderForKids"):"true"===params.IsAiring?_globalize.default.translate("HeaderOnNow"):"true"===params.IsSeries?params.IsNewOrPremiere?_globalize.default.translate("TitleNewEpisodes"):_globalize.default.translate("Shows"):"true"===params.IsNews?_globalize.default.translate("News"):_globalize.default.translate("Program"):"nextup"===params.type?_globalize.default.translate("HeaderNextUp"):this.getParentItem()||(params.type?_itemmanager.default.getPluralItemTypeName(params.type):void 0)},ItemsView.prototype.fetchItem=function(){var apiClient,params=this.params;return"Recordings"!==params.type&&"Program"!==params.type&&"nextup"!==params.type&&"search"!==params.type&&"OnNow"!==params.type&&params.serverId&&(apiClient=this.getApiClient(),params=params.genreId||params.gameGenreId||params.musicGenreId||params.studioId||params.tagId||params.artistId||params.albumArtistId||params.personId||params.parentId)&&"downloads"!==params?apiClient.getItem(apiClient.getCurrentUserId(),params):Promise.resolve(null)},ItemsView.prototype.onItemRefreshed=function(item){item?(_backdrop.default.setBackdrops([item]),dispatchItemShowEvent(this.view,"itemshow",item)):(_backdrop.default.clear(),dispatchItemShowEvent(this.view,"itemclear",item)),this.setTitle()},ItemsView.prototype.onResume=function(options){_baseview.default.prototype.onResume.apply(this,arguments);var refresh=options.refresh,instance=(this.setTitle(),this),resumeArgs=arguments;return this.fetchItem().then(function(item){instance.currentItem=item,instance.onItemRefreshed(item);item=instance.view;return instance.supportsPlay()?hideOrShowAll(item.querySelectorAll(".btnPlay"),!1):hideOrShowAll(item.querySelectorAll(".btnPlay"),!0),instance.supportsShuffle()?hideOrShowAll(item.querySelectorAll(".btnShuffle"),!1):hideOrShowAll(item.querySelectorAll(".btnShuffle"),!0),instance.supportsQueue()?hideOrShowAll(item.querySelectorAll(".btnQueue"),!1):hideOrShowAll(item.querySelectorAll(".btnQueue"),!0),_listcontroller.default.prototype.resume.apply(instance,resumeArgs).then(function(){var searchFields=instance.searchFields;searchFields&&searchFields.resume({refresh:refresh}),refresh&&instance.autoFocus()})})},ItemsView.prototype.onPause=function(){_baseview.default.prototype.onPause.apply(this,arguments);var searchFields=this.searchFields;searchFields&&searchFields.pause(),_listcontroller.default.prototype.pause.apply(this,arguments)},ItemsView.prototype.destroy=function(){_baseview.default.prototype.destroy.apply(this,arguments),_listcontroller.default.prototype.destroy.apply(this,arguments),this.searchFields&&(this.searchFields.destroy(),this.searchFields=null),this.currentItem=null},ItemsView.prototype.getContext=function(){return this.params.context||_listcontroller.default.prototype.getContext.apply(this,arguments)},ItemsView.prototype.enableAutoFolderJumpThrough=function(toItem){return"Audio"!==toItem.Type||!!toItem.SupportsResume},ItemsView.prototype.getCardOptions=function(items,settings){var activeSearchTab,options=_listcontroller.default.prototype.getCardOptions.apply(this,arguments);return"search"===this.params.type&&(activeSearchTab=this.view.querySelector(".emby-searchable-tab-button.emby-tab-button-active"))&&"MusicArtist"===activeSearchTab.getAttribute("data-searchtype")&&(options.round=!0),options},ItemsView.prototype.getListViewOptions=function(items,settings){var options=_listcontroller.default.prototype.getListViewOptions.apply(this,arguments);return"search"===this.params.type&&(options.imageSize="small"),options},ItemsView.prototype.getCommandOptions=function(){var options=_listcontroller.default.prototype.getCommandOptions.apply(this,arguments);return options.removeFromNextUp="nextup"===this.params.type,options.createRecording="OnNow"!==this.params.type,options},ItemsView.prototype.getItems=function(initialQuery,signal){return"downloads"===this.params.parentId?Promise.all(_connectionmanager.default.getApiClients().map(getTopLevelDownloadFolders)).then(function(responses){for(var list=[],i=0,length=responses.length;i<length;i++)list=list.concat(responses[i]);return list}):_listcontroller.default.prototype.getItems.apply(this,arguments)},ItemsView.prototype.getApiClientQueryMethodName=function(){var params=this.params;return"MusicArtist"===params.type?"getArtists":"Person"===params.type?"getPeople":"Recordings"===params.type?"getLiveTvRecordings":"OnNow"===params.type?"getLiveTvChannels":"nextup"===params.type?"getNextUpEpisodes":"missingepisodes"===params.type?"getMissingEpisodes":_listcontroller.default.prototype.getApiClientQueryMethodName.apply(this,arguments)},ItemsView.prototype.getPrefixes=function(){return"downloads"===this.params.parentId?Promise.resolve([]):_listcontroller.default.prototype.getPrefixes.apply(this,arguments)},ItemsView.prototype.getPrefixesApiClientMethodName=function(){return"MusicArtist"===this.params.type?"getArtistPrefixes":_listcontroller.default.prototype.getPrefixesApiClientMethodName.apply(this,arguments)},ItemsView.prototype.getPrefixQueryIncludeItemTypes=function(){return"MusicArtist"===this.params.type?[]:_listcontroller.default.prototype.getPrefixQueryIncludeItemTypes.apply(this,arguments)},ItemsView.prototype.getQueryIncludeItemTypes=function(){var params=this.params;if(params.musicGenreId)return"MusicArtist"===(type=params.type||null)?[]:type?[type]:["MusicAlbum","MusicVideo"];if(params.gameGenreId)return["Game"];if(params.genreId)return(type=params.type||null)?[type]:["Movie","Series","Video","Game","MusicAlbum"];if(params.personId)return(type=params.type||null)?[type]:[];if(params.studioId)return["Movie","Series","Video","Game"];var _type3,type=this.getParentItem();if(type){if("MusicGenre"===type.Type)return["MusicAlbum","MusicVideo"];if("GameGenre"===type.Type)return["Game"];if("Genre"===type.Type)return["Movie","Series","Video"];if("Person"===type.Type)return(_type3=params.type||null)?[_type3]:[];if("Studio"===type.Type)return["Movie","Series","Video","Game"];if("movies"===type.CollectionType)return["Movie"];if("tvshows"===type.CollectionType)return["Series"]}return"MusicArtist"===params.type||"Person"===params.type||"search"===params.type||"OnNow"===params.type?[]:_listcontroller.default.prototype.getQueryIncludeItemTypes.apply(this,arguments)},ItemsView.prototype.saveSortingOnServer=function(){return"OnNow"!==this.params.type&&_listcontroller.default.prototype.saveSortingOnServer.apply(this,arguments)},ItemsView.prototype.refreshSearchTabs=function(tabs){tabs.length&&tabs.unshift({Name:_globalize.default.translate("HeaderTopResults"),Id:"all"}),1<tabs.length&&(html=(html='<div is="emby-tabs" class="searchTabsContainer searchFieldsBottomBorder padded-bottom focuscontainer-x"><div class="emby-tabs-slider scrollSliderX padded-top-focusscale padded-bottom-focusscale padded-left padded-left-page padded-right searchTabsScroller">')+tabs.map(function(tab,index){var pluralName="all"===tab.Id?tab.Name:_itemmanager.default.getPluralItemTypeName(tab.Name);return'<button type="button" is="emby-button" class="emby-searchable-tab-button secondaryText emby-search-tab-button emby-tab-button emby-button" data-searchtype="'+(tab.Id||tab.Name)+'" data-index="'+index+'">'+pluralName+"</button>"}).join("")+"</div></div>");var html,tabs=this.view.querySelector(".searchTabs");(tabs.innerHTML=html)?(tabs.classList.remove("hide"),tabs.querySelector(".searchTabsContainer").addEventListener("tabchange",function(){this.itemsContainer.refreshItems()}.bind(this))):tabs.classList.add("hide")},ItemsView.prototype.setTitle=function(){var title;!1!==this.params.setTitle&&(title=this.getTitle(),_appheader.default.setTitle(title||""))},ItemsView.prototype.getSortBySettingsKey=function(sortMenuOptions){return"OnNow"===this.params.type?_usersettings.default.getLiveTvChannelSortSettingsKey():_listcontroller.default.prototype.getSortBySettingsKey.apply(this,arguments)},ItemsView.prototype.getSortByValue=function(){var query;return"OnNow"===this.params.type?(_usersettings.default.addLiveTvChannelSortingToQuery(query={},_globalize.default),query.SortBy):_listcontroller.default.prototype.getSortByValue.apply(this,arguments)},ItemsView.prototype.getDefaultSorting=function(){var query;return"OnNow"===this.params.type?(_usersettings.default.addLiveTvChannelSortingToQuery(query={},_globalize.default),{sortBy:query.SortBy,sortOrder:query.SortOrder}):_listcontroller.default.prototype.getDefaultSorting.apply(this,arguments)},ItemsView.prototype.supportsPlay=function(){var params=this.params,parentItem=this.getParentItem(),parentItem=null==parentItem?void 0:parentItem.CollectionType;return"downloads"!==params.parentId&&"search"!==params.type&&"missingepisodes"!==params.type&&"playlists"!==parentItem&&"boxsets"!==parentItem&&_listcontroller.default.prototype.supportsPlay.apply(this,arguments)},ItemsView.prototype.supportsShuffle=function(){var params=this.params,parentItem=this.getParentItem(),itemType=null==parentItem?void 0:parentItem.Type,parentItem=null==parentItem?void 0:parentItem.CollectionType;return"downloads"!==params.parentId&&"search"!==params.type&&"missingepisodes"!==params.type&&"playlists"!==parentItem&&"boxsets"!==parentItem&&("MusicGenre"===itemType||"Program"!==params.type&&"TvChannel"!==params.type&&"OnNow"!==params.type&&"nextup"!==params.type&&"Game"!==params.type&&"Channel"!==itemType&&"GameSystem"!==itemType&&"GameGenre"!==itemType)&&this.supportsPlay()},ItemsView.prototype.supportsQueue=function(){var params=this.params,parentItem=this.getParentItem(),parentItem=null==parentItem?void 0:parentItem.CollectionType;if("downloads"!==params.parentId&&"search"!==params.type&&"missingepisodes"!==params.type&&"playlists"!==parentItem&&"boxsets"!==parentItem&&this.supportsPlay()){params=this.getParentItem();if(params)return _playbackmanager.default.canQueue(params)}return!1},ItemsView.prototype.getSortMenuOptions=function(){var params=this.params;if("downloads"===params.parentId)return[];switch(params.type){case"nextup":case"search":case"missingepisodes":return[];case"OnNow":return _usersettings.default.getLiveTvChannelSortOrders(_globalize.default);default:return _listcontroller.default.prototype.getSortMenuOptions.apply(this,arguments)}},ItemsView.prototype.getVisibleFilters=function(){var params=this.params;if("downloads"===params.parentId)return[];switch(params.type){case"nextup":case"OnNow":case"search":case"missingepisodes":return[];default:return _listcontroller.default.prototype.getVisibleFilters.apply(this,arguments)}},ItemsView.prototype.getDisplayPreset=function(){var params=this.params;return params.mediaTypes?params.mediaTypes.split(",")[0]:_listcontroller.default.prototype.getDisplayPreset.apply(this,arguments)},ItemsView.prototype.getViewSettingDefaults=function(parentItem,listItems,availableFieldIds){var activeSearchTab,defaults=_listcontroller.default.prototype.getViewSettingDefaults.apply(this,arguments),params=this.params;return"search"===params.type?(defaults.fields=["Name"],!(activeSearchTab=this.view.querySelector(".emby-searchable-tab-button.emby-tab-button-active"))||"all"===(activeSearchTab=activeSearchTab.getAttribute("data-searchtype"))?(defaults.fields.push("Type"),defaults.fields.push("ProductionYear")):"Movie"===activeSearchTab||"Series"===activeSearchTab||"Trailer"===activeSearchTab?defaults.fields.push("ProductionYear"):"Audio"===activeSearchTab&&(defaults.imageType="list")):"nextup"===params.type&&(defaults.imageType=this.params.defaultView||"thumb"),defaults},ItemsView.prototype.getItemTypes=function(){var params=this.params,paramsType=params.type;switch(paramsType){case"nextup":case"missingepisodes":return["Episode"];case"OnNow":return["TvChannel"];case"search":return[];case"Recordings":return"true"===params.GroupItems?["Series","Video","Movie"]:["Episode","Video","Movie"];default:return paramsType?paramsType.split(","):[]}},ItemsView.prototype.getSettingsKey=function(){var values=[],params=(values.push("items"),this.params);return params.type?values.push(params.type):params.mediaTypes?values.push(params.mediaTypes):params.parentId&&values.push(params.parentId),params.IsAiring&&values.push("IsAiring"),params.IsMovie&&values.push("IsMovie"),params.IsKids&&values.push("IsKids"),params.IsSports&&values.push("IsSports"),params.IsNews&&values.push("IsNews"),params.IsSeries&&values.push("IsSeries"),params.IsFavorite&&values.push("IsFavorite"),params.genreId&&values.push("Genre"),params.gameGenreId&&values.push("GameGenre"),params.musicGenreId&&values.push("MusicGenre"),params.studioId&&values.push("Studio"),params.tagId&&values.push("Tag"),params.personId&&values.push("Person"),params.parentId&&values.push("Folder"),values.join("-")};_exports.default=ItemsView});

Anon7 - 2021