"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[90520],{97837:function(e,t,o){o.r(t),o(44962),o(78557),o(90076),o(83994),o(82367),o(96244);var r=o(8566),n=o(5898),c=(o(10353),o(89100)),i=o(41177);function a(){r.Ay.show();var e=this;return ApiClient.getNamedConfiguration("livetv").then((function(t){t.GuideDays=e.querySelector("#selectGuideDays").value||null;var o=e.querySelector("#txtRecordingPath").value||null,r=e.querySelector("#txtMovieRecordingPath").value||null,a=e.querySelector("#txtSeriesRecordingPath").value||null,l=o!=t.RecordingPath||r!=t.MovieRecordingPath||a!=t.SeriesRecordingPath;t.RecordingPath=o,t.MovieRecordingPath=r,t.SeriesRecordingPath=a,t.RecordingEncodingFormat="mkv",t.PrePaddingSeconds=60*e.querySelector("#txtPrePaddingMinutes").value,t.PostPaddingSeconds=60*e.querySelector("#txtPostPaddingMinutes").value,t.RecordingPostProcessor=e.querySelector("#txtPostProcessor").value,t.RecordingPostProcessorArguments=e.querySelector("#txtPostProcessorArguments").value,t.SaveRecordingNFO=e.querySelector("#chkSaveRecordingNFO").checked,t.SaveRecordingImages=e.querySelector("#chkSaveRecordingImages").checked,ApiClient.updateNamedConfiguration("livetv",t).then((function(){c.default.processServerConfigurationUpdateResult(),function(e){var t="";e&&(t+=n.Ay.translate("MessageChangeRecordingPath")),t&&(0,i.A)(t)}(l)}))})),!1}$(document).on("pageinit","#liveTvSettingsPage",(function(){var e=this;$(".liveTvSettingsForm").off("submit",a).on("submit",a),$("#btnSelectRecordingPath",e).on("click.selectDirectory",(function(){Promise.resolve().then(o.bind(o,21840)).then((function(t){var o=new(0,t.default);o.show({callback:function(t){t&&(e.querySelector("#txtRecordingPath").value=t),o.close()},validateWriteable:!0})}))})),$("#btnSelectMovieRecordingPath",e).on("click.selectDirectory",(function(){Promise.resolve().then(o.bind(o,21840)).then((function(t){var o=new(0,t.default);o.show({callback:function(t){t&&(e.querySelector("#txtMovieRecordingPath").value=t),o.close()},validateWriteable:!0})}))})),$("#btnSelectSeriesRecordingPath",e).on("click.selectDirectory",(function(){Promise.resolve().then(o.bind(o,21840)).then((function(t){var o=new(0,t.default);o.show({callback:function(t){t&&(e.querySelector("#txtSeriesRecordingPath").value=t),o.close()},validateWriteable:!0})}))})),$("#btnSelectPostProcessorPath",e).on("click.selectDirectory",(function(){Promise.resolve().then(o.bind(o,21840)).then((function(t){var o=new(0,t.default);o.show({includeFiles:!0,callback:function(t){t&&(e.querySelector("#txtPostProcessor").value=t),o.close()}})}))}))})).on("pageshow","#liveTvSettingsPage",(function(){r.Ay.show();var e=this;ApiClient.getNamedConfiguration("livetv").then((function(t){!function(e,t){var o;e.querySelector(".liveTvSettingsForm").classList.remove("hide"),null===(o=e.querySelector(".noLiveTvServices"))||void 0===o||o.classList.add("hide"),e.querySelector("#selectGuideDays").value=t.GuideDays||"",e.querySelector("#txtPrePaddingMinutes").value=t.PrePaddingSeconds/60,e.querySelector("#txtPostPaddingMinutes").value=t.PostPaddingSeconds/60,e.querySelector("#txtRecordingPath").value=t.RecordingPath||"",e.querySelector("#txtMovieRecordingPath").value=t.MovieRecordingPath||"",e.querySelector("#txtSeriesRecordingPath").value=t.SeriesRecordingPath||"",e.querySelector("#txtPostProcessor").value=t.RecordingPostProcessor||"",e.querySelector("#txtPostProcessorArguments").value=t.RecordingPostProcessorArguments||"",e.querySelector("#chkSaveRecordingNFO").checked=t.SaveRecordingNFO,e.querySelector("#chkSaveRecordingImages").checked=t.SaveRecordingImages,r.Ay.hide()}(e,t)}))}))}}]);