Files
pgsql-jellyfin/Jellyfin.Server/wwwroot/30657.ab2e0985d6436bfe3a8c.chunk.js
2026-07-08 13:13:46 -04:00

1 line
6.4 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28312,30657,96084],{84826:function(e,t,r){r.r(t),r.d(t,{MediaLibraryCreator:function(){return w},default:function(){return k}}),r(29305),r(32733),r(84701),r(81678),r(24776),r(14382),r(69703),r(44962),r(86584),r(4754),r(94),r(36947),r(78557),r(96054),r(90076),r(95021),r(83994),r(93062),r(46968),r(97747),r(82367);var i=r(22696),n=r.n(i),a=r(8566),o=r(79754),l=r(36300),s=r(9938),c=r(5898),d=(r(10353),r(15453),r(98959),r(63001),r(6882),r(71866)),u=r(41177);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function p(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,b(i.key),i)}}function f(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(e){var t=function(e){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}function v(e){if(e.preventDefault(),P)return!1;if(0==T.length)return(0,u.A)({text:c.Ay.translate("PleaseAddAtLeastOneFolder"),type:"error"}),!1;P=!0,a.Ay.show();var t=l.Ay.parentWithClass(this,"dlg-librarycreator"),r=t.querySelector("#txtValue").value.trim(),i=t.querySelector("#selectCollectionType").value;if(0===r.length)return(0,u.A)({text:c.Ay.translate("LibraryNameInvalid"),type:"error"}),P=!1,a.Ay.hide(),!1;"mixed"==i&&(i=null);var n=s.Ay.getLibraryOptions(t.querySelector(".libraryOptions"));n.PathInfos=T,ApiClient.addVirtualFolder(r,i,S.refresh,n).then((function(){q=!0,P=!1,a.Ay.hide(),o.default.close(t)}),(function(){(0,d.A)(c.Ay.translate("ErrorAddingMediaPathToVirtualFolder")),P=!1,a.Ay.hide()}))}function m(){var e=l.Ay.parentWithClass(this,"dlg-librarycreator");Promise.resolve().then(r.bind(r,21840)).then((function(t){var r=new(0,t.default);r.show({callback:function(t){t&&function(e,t){var r=t.toLowerCase();if(!T.filter((function(e){return e.Path.toLowerCase()==r})).length){var i={Path:t};T.push(i),L(e)}}(e,t),r.close()}})}))}function h(e,t){var r="";return r+='<div class="listItem listItem-border lnkPath">',r+='<div class="'.concat(e.NetworkPath?"listItemBody two-line":"listItemBody",'">'),r+='<div class="listItemBodyText" dir="ltr">'.concat(n()(e.Path),"</div>"),e.NetworkPath&&(r+='<div class="listItemBodyText secondary" dir="ltr">'.concat(n()(e.NetworkPath),"</div>")),r+="</div>",(r+='<button type="button" is="paper-icon-button-light"" class="listItemButton btnRemovePath" data-index="'.concat(t,'"><span class="material-icons remove_circle" aria-hidden="true"></span></button>'))+"</div>"}function L(e){var t=T.map(h).join(""),r=e.querySelector(".folderList");r.innerHTML=t,t?r.classList.remove("hide"):r.classList.add("hide")}function g(e){var t=l.Ay.parentWithClass(e.target,"btnRemovePath"),r=parseInt(t.getAttribute("data-index"),10),i=T[r].Path.toLowerCase();T=T.filter((function(e){return e.Path.toLowerCase()!=i})),L(l.Ay.parentWithClass(t,"dlg-librarycreator"))}function A(){C(q)}var C,S,w=f((function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new Promise((function(e){S=t,C=e,q=!1;var r,i,n,a=o.default.createDialog({size:"small",modal:!1,removeOnClose:!0,scrollY:!1});a.classList.add("ui-body-a"),a.classList.add("background-theme-a"),a.classList.add("dlg-librarycreator"),a.classList.add("formDialog"),a.innerHTML=c.Ay.translateHtml('<div class="formDialogHeader"> <button type="button" is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1" title="${ButtonBack}"><span class="material-icons arrow_back" aria-hidden="true"></span></button> <h3 class="formDialogHeaderTitle">${ButtonAddMediaLibrary}</h3> </div> <div class="formDialogContent scrollY" style="padding-top:2em"> <div class="dialogContentInner dialog-content-centered"> <form class="addLibraryForm" style="max-width:100%"> <div id="fldCollectionType" class="selectContainer"> <select is="emby-select" id="selectCollectionType" data-mini="true" required="required" label="${LabelContentType}"></select> <div class="collectionTypeFieldDescription fieldDescription"> </div> </div> <div class="inputContainer"> <input is="emby-input" type="text" id="txtValue" required="required" label="${LabelDisplayName}"/> </div> <div class="folders"> <div style="display:flex;align-items:center"> <h1 style="margin:.5em 0">${Folders}</h1> <button is="emby-button" type="button" class="fab btnAddFolder submit" title="${Add}"> <span class="material-icons add" aria-hidden="true"></span> </button> </div> <div class="paperList folderList hide" style="margin-bottom:2em"></div> </div> <div class="libraryOptions"></div> <div class="formDialogFooter"> <button is="emby-button" type="submit" class="raised btnSubmit button-submit block formDialogFooterItem"> <span>${ButtonOk}</span> </button> </div> </form> </div> </div> '),r=a,i=t.collectionTypeOptions,(n=r.querySelector("#selectCollectionType")).innerHTML=function(e){return e.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.name,"</option>")})).join("")}(i),n.value="",n.addEventListener("change",(function(){var e=this.value,t=l.Ay.parentWithClass(this,"dialog");if(s.Ay.setContentType(t.querySelector(".libraryOptions"),e),e?t.querySelector(".libraryOptions").classList.remove("hide"):t.querySelector(".libraryOptions").classList.add("hide"),"mixed"!=e){var r=this.selectedIndex;if(-1!=r){var n=this.options[r].innerHTML.replaceAll("*","").replaceAll("&amp;","&");t.querySelector("#txtValue").value=n}}var a=i.find((function(t){return t.value===e}));t.querySelector(".collectionTypeFieldDescription").innerHTML=(null==a?void 0:a.message)||""})),r.querySelector(".btnAddFolder").addEventListener("click",m),r.querySelector(".addLibraryForm").addEventListener("submit",v),r.querySelector(".folderList").addEventListener("click",g),a.addEventListener("close",A),o.default.open(a),a.querySelector(".btnCancel").addEventListener("click",(function(){o.default.close(a)})),T=[],L(a),function(e){s.Ay.embed(e.querySelector(".libraryOptions")).then((function(){e.querySelector("#selectCollectionType").dispatchEvent(new Event("change"))}))}(a)}))})),T=[],q=!1,P=!1,k=w}}]);