1 line
9.3 KiB
JavaScript
1 line
9.3 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8241],{36720:function(e,n,t){t.d(n,{_r:function(){return l},t5:function(){return i}});var r=t(94732),o=t(80401),a=t(69410),i="Configuration",l=function(){var e=(0,a.gf)().api;return(0,o.I)({queryKey:[i],queryFn:function(n){var t=n.signal;return function(e,n){return t=void 0,o=void 0,i=function(){return function(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,(function(t){switch(t.label){case 0:return[4,(0,r.T)(e).getConfiguration(n)];case 1:return[2,t.sent().data]}}))},new((a=void 0)||(a=Promise))((function(e,n){function r(e){try{s(i.next(e))}catch(e){n(e)}}function l(e){try{s(i.throw(e))}catch(e){n(e)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,l)}s((i=i.apply(t,o||[])).next())}));var t,o,a,i}(e,{signal:t})},enabled:!!e})}},52433:function(e,n,t){t.r(n),t.d(n,{Component:function(){return E},action:function(){return I}});var r=t(62540),o=(t(63696),t(47891)),a=t(92779),i=t(63703),l=t(31720),s=t(96441),u=t(26523),c=t(85637),d=t(70140),f=t(70564),p=t(57836),y=t(89348),h=t(84849),b=t(65242),v=t(94732),A=t(36720),g=t(78397),x=t(5898),w=t(67430),S=t(87404),j=t(9055),m=t(31297),C="metadata",I=function(e){return n=void 0,t=[e],o=function(e){var n,t,r,o,a,i,l,s,u,c,d=e.request;return function(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,(function(e){switch(e.label){case 0:if(!(n=w.tF.getCurrentApi()))throw new Error("No Api instance available");return[4,d.formData()];case 1:return t=e.sent(),r=Object.fromEntries(t),[4,(0,v.T)(n).getConfiguration()];case 2:return o=e.sent().data,a={UseFileCreationTimeForDateAdded:"1"===r.DateAddedBehavior.toString()},o.EnableFolderView="on"===(null===(i=r.DisplayFolderView)||void 0===i?void 0:i.toString()),o.DisplaySpecialsWithinSeasons="on"===(null===(l=r.DisplaySpecialsWithinSeasons)||void 0===l?void 0:l.toString()),o.EnableGroupingMoviesIntoCollections="on"===(null===(s=r.GroupMoviesIntoCollections)||void 0===s?void 0:s.toString()),o.EnableGroupingShowsIntoCollections="on"===(null===(u=r.GroupShowsIntoCollections)||void 0===u?void 0:u.toString()),o.EnableExternalContentInSuggestions="on"===(null===(c=r.EnableExternalContentInSuggestions)||void 0===c?void 0:c.toString()),[4,(0,v.T)(n).updateConfiguration({serverConfiguration:o})];case 3:return e.sent(),[4,(0,v.T)(n).updateNamedConfiguration({key:C,body:a})];case 4:return e.sent(),m.q.invalidateQueries({queryKey:[A.t5]}),m.q.invalidateQueries({queryKey:[g.t,C]}),[2,{isSaved:!0}]}}))},new((r=void 0)||(r=Promise))((function(e,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}s((o=o.apply(n,t||[])).next())}));var n,t,r,o},E=function(){var e=(0,A._r)(),n=e.data,t=e.isPending,v=e.isError,w=(0,g.M)(C),m=w.data,I=w.isPending,E=w.isError,k=(0,S.cq)(),D=(0,S.mP)(),G="submitting"===k.state;return t||I?(0,r.jsx)(h.A,{}):(0,r.jsx)(b.A,{id:"libraryDisplayPage",title:x.Ay.translate("Display"),className:"mainAnimatedPage type-interior",children:(0,r.jsx)(a.A,{className:"content-primary",children:v||E?(0,r.jsx)(o.A,{severity:"error",children:x.Ay.translate("DisplayLoadError")}):(0,r.jsx)(j.lV,{method:"POST",children:(0,r.jsxs)(d.A,{spacing:3,children:[!G&&(null==D?void 0:D.isSaved)&&(0,r.jsx)(o.A,{severity:"success",children:x.Ay.translate("SettingsSaved")}),(0,r.jsx)(y.A,{variant:"h1",children:x.Ay.translate("Display")}),(0,r.jsxs)(p.A,{name:"DateAddedBehavior",label:x.Ay.translate("LabelDateAddedBehavior"),select:!0,defaultValue:m.UseFileCreationTimeForDateAdded?"1":"0",helperText:x.Ay.translate("LabelDateAddedBehaviorHelp"),children:[(0,r.jsx)(c.A,{value:"0",children:x.Ay.translate("OptionDateAddedImportTime")}),(0,r.jsx)(c.A,{value:"1",children:x.Ay.translate("OptionDateAddedFileTime")})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{control:(0,r.jsx)(f.A,{name:"DisplayFolderView",defaultChecked:n.EnableFolderView}),label:x.Ay.translate("OptionDisplayFolderView")}),(0,r.jsx)(u.A,{children:x.Ay.translate("OptionDisplayFolderViewHelp")})]}),(0,r.jsx)(l.A,{children:(0,r.jsx)(s.A,{control:(0,r.jsx)(f.A,{name:"DisplaySpecialsWithinSeasons",defaultChecked:n.DisplaySpecialsWithinSeasons}),label:x.Ay.translate("LabelDisplaySpecialsWithinSeasons")})}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{control:(0,r.jsx)(f.A,{name:"GroupMoviesIntoCollections",defaultChecked:n.EnableGroupingMoviesIntoCollections}),label:x.Ay.translate("LabelGroupMoviesIntoCollections")}),(0,r.jsx)(u.A,{children:x.Ay.translate("LabelGroupMoviesIntoCollectionsHelp")})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{control:(0,r.jsx)(f.A,{name:"GroupShowsIntoCollections",defaultChecked:n.EnableGroupingShowsIntoCollections}),label:x.Ay.translate("LabelGroupShowsIntoCollections")}),(0,r.jsx)(u.A,{children:x.Ay.translate("LabelGroupShowsIntoCollectionsHelp")})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{control:(0,r.jsx)(f.A,{name:"EnableExternalContentInSuggestions",defaultChecked:n.EnableExternalContentInSuggestions}),label:x.Ay.translate("OptionEnableExternalContentInSuggestions")}),(0,r.jsx)(u.A,{children:x.Ay.translate("OptionEnableExternalContentInSuggestionsHelp")})]}),(0,r.jsx)(i.A,{type:"submit",size:"large",children:x.Ay.translate("Save")})]})})})})};E.displayName="DisplayPage"},78397:function(e,n,t){t.d(n,{M:function(){return l},t:function(){return i}});var r=t(94732),o=t(80401),a=t(69410),i="NamedConfiguration",l=function(e){var n=(0,a.gf)().api;return(0,o.I)({queryKey:[i,e],queryFn:function(t){var o=t.signal;return function(e,n,t){return o=void 0,a=void 0,l=function(){return function(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,(function(o){switch(o.label){case 0:return[4,(0,r.T)(e).getNamedConfiguration({key:n},t)];case 1:return[2,o.sent().data]}}))},new((i=void 0)||(i=Promise))((function(e,n){function t(e){try{s(l.next(e))}catch(e){n(e)}}function r(e){try{s(l.throw(e))}catch(e){n(e)}}function s(n){var o;n.done?e(n.value):(o=n.value,o instanceof i?o:new i((function(e){e(o)}))).then(t,r)}s((l=l.apply(o,a||[])).next())}));var o,a,i,l}(n,e,{signal:o})},enabled:!!n})}}}]); |