1 line
2.7 KiB
JavaScript
1 line
2.7 KiB
JavaScript
|
|
import ItemsTab from"./../modules/tabbedview/itemstab.js";import"./../modules/emby-elements/emby-button/emby-button.js";import"./../modules/emby-elements/emby-scroller/emby-scroller.js";import"./../modules/emby-elements/emby-itemscontainer/emby-itemscontainer.js";import globalize from"./../modules/common/globalize.js";import TaskButton from"./../components/taskbutton.js";import LibrariesController from"./librariescontroller.js";function LibraryTab(view,params){this.supportsViewSettings=!1,this.hasOtherViewButtons=!0,this.enableAlphaNumericShortcuts=!1,ItemsTab.apply(this,arguments)}Object.assign(LibraryTab.prototype,ItemsTab.prototype),LibraryTab.prototype.onTemplateLoaded=function(){ItemsTab.prototype.onTemplateLoaded.apply(this,arguments),this.itemsContainer.refreshOnItemUpdated=!0,LibrariesController.addButtons(this,!0);var btnRefresh=this.view.querySelector(".btnRefresh");btnRefresh&&(this.libraryScanTaskButton=new TaskButton({progressElem:this.view.querySelector(".refreshProgress"),taskKey:"RefreshLibrary",button:btnRefresh}))},LibraryTab.prototype.onResume=function(options){ItemsTab.prototype.onResume.apply(this,arguments),this.libraryScanTaskButton?.resume({})},LibraryTab.prototype.onPause=function(){ItemsTab.prototype.onPause.apply(this,arguments),this.libraryScanTaskButton?.pause()},LibraryTab.prototype.loadTemplate=function(){return this.loadItemsTemplate()},LibraryTab.prototype.getItems=function(query){return this.getApiClient().getVirtualFolders(query)},LibraryTab.prototype.getItemTypes=function(){return["VirtualFolder"]},LibraryTab.prototype.getSettingsKey=function(){return"libraries"},LibraryTab.prototype.getEmptyListMessage=function(){return Promise.resolve("")},LibraryTab.prototype.getItemCountText=function(numItems){return 1===numItems?globalize.translate("OneLibrary"):globalize.translate("LibraryCountValue",numItems)},LibraryTab.prototype.getContext=function(){return null},LibraryTab.prototype.getBaseListRendererOptions=function(){var options=ItemsTab.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.draggableXActions=!0,options.multiSelect=!1,options.action="edit",options},LibraryTab.prototype.getCardOptions=function(items,settings){var options=ItemsTab.prototype.getCardOptions.apply(this,arguments);return Object.assign(options,{shape:"backdrop",fields:["Name","CollectionType","LibraryFolders"],cardLayout:!0,hoverPlayButton:!1,defaultBackground:!0,linkButtonAction:"edit"})},LibraryTab.prototype.getSortMenuOptions=function(){return[]},LibraryTab.prototype.destroy=function(){ItemsTab.prototype.destroy.apply(this,arguments),this.libraryScanTaskButton?.destroy(),this.libraryScanTaskButton=null};export default LibraryTab;
|