diff --git a/CHANGELOG.md b/CHANGELOG.md index 22a926025c..5c09cd9f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Fix adding Anime with white/black listed release groups ([#7507](https://github.com/pymedusa/Medusa/pull/7507)) - Fix Schedule page and Forced Search on Schedule page ([#7512](https://github.com/pymedusa/Medusa/pull/7512)) - Fix manual search page release name bug ([#7517](https://github.com/pymedusa/Medusa/pull/7517)) +- Fix being unable to save post-processing config ([#7526](https://github.com/pymedusa/Medusa/pull/7526)) ----- diff --git a/medusa/server/api/v2/config.py b/medusa/server/api/v2/config.py index af4856ae3a..5553e7dbc2 100644 --- a/medusa/server/api/v2/config.py +++ b/medusa/server/api/v2/config.py @@ -230,7 +230,6 @@ class ConfigHandler(BaseRequestHandler): 'postProcessing.syncFiles': ListField(app, 'SYNC_FILES'), 'postProcessing.fileTimestampTimezone': StringField(app, 'FILE_TIMESTAMP_TIMEZONE'), 'postProcessing.extraScripts': ListField(app, 'EXTRA_SCRIPTS'), - 'postProcessing.extraScriptsUrl': StringField(app, 'EXTRA_SCRIPTS_URL'), 'postProcessing.naming.pattern': StringField(app, 'NAMING_PATTERN'), 'postProcessing.naming.enableCustomNamingAnime': BooleanField(app, 'NAMING_CUSTOM_ANIME'), 'postProcessing.naming.enableCustomNamingSports': BooleanField(app, 'NAMING_CUSTOM_SPORTS'), diff --git a/themes-default/slim/src/components/config-post-processing.vue b/themes-default/slim/src/components/config-post-processing.vue index 37c0808588..7ab2c21fc1 100644 --- a/themes-default/slim/src/components/config-post-processing.vue +++ b/themes-default/slim/src/components/config-post-processing.vue @@ -459,12 +459,12 @@ export default { // Clone the config into a new object const config = Object.assign({}, { - postprocessing, + postProcessing: postprocessing, metadata }); // Use destructuring to remove the unwanted keys. - const { multiEpStrings, reflinkAvailable, ...rest } = postprocessing; + const { multiEpStrings, reflinkAvailable, extraScriptsUrl, ...rest } = postprocessing; // Assign the object with the keys removed to our copied object. config.postProcessing = rest; diff --git a/themes/dark/assets/js/medusa-runtime.js b/themes/dark/assets/js/medusa-runtime.js index 5225e4f0d9..fa9eee4885 100644 --- a/themes/dark/assets/js/medusa-runtime.js +++ b/themes/dark/assets/js/medusa-runtime.js @@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(f /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-js-toggle-button */ \"./node_modules/vue-js-toggle-button/dist/index.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'config-post-processing',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"AppLink\"],\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"FileBrowser\"],\n NamePattern: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"NamePattern\"],\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"SelectList\"],\n ToggleButton: vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__[\"ToggleButton\"]\n },\n\n data() {\n return {\n presets: [{\n pattern: '%SN - %Sx%0E - %EN',\n example: 'Show Name - 2x03 - Ep Name'\n }, {\n pattern: '%S.N.S%0SE%0E.%E.N',\n example: 'Show.Name.S02E03.Ep.Name'\n }, {\n pattern: '%Sx%0E - %EN',\n example: '2x03 - Ep Name'\n }, {\n pattern: 'S%0SE%0E - %EN',\n example: 'S02E03 - Ep Name'\n }, {\n pattern: 'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG',\n example: 'Season 02/Show.Name.S02E03.720p.HDTV-RLSGROUP'\n }],\n processMethods: [{\n value: 'copy',\n text: 'Copy'\n }, {\n value: 'move',\n text: 'Move'\n }, {\n value: 'hardlink',\n text: 'Hard Link'\n }, {\n value: 'symlink',\n text: 'Symbolic Link'\n }],\n timezoneOptions: [{\n value: 'local',\n text: 'Local'\n }, {\n value: 'network',\n text: 'Network'\n }],\n metadataProviderSelected: null\n };\n },\n\n methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapActions\"])(['setConfig']), {\n onChangeSyncFiles(items) {\n const {\n postprocessing\n } = this;\n postprocessing.syncFiles = items.map(item => item.value);\n },\n\n onChangeAllowedExtensions(items) {\n const {\n postprocessing\n } = this;\n postprocessing.allowedExtensions = items.map(item => item.value);\n },\n\n onChangeExtraScripts(items) {\n const {\n postprocessing\n } = this;\n postprocessing.extraScripts = items.map(item => item.value);\n },\n\n saveNaming(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.pattern = values.pattern;\n postprocessing.naming.multiEp = values.multiEpStyle;\n },\n\n saveNamingSports(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternSports = values.pattern;\n postprocessing.naming.enableCustomNamingSports = values.enabled;\n },\n\n saveNamingAbd(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAirByDate = values.pattern;\n postprocessing.naming.enableCustomNamingAirByDate = values.enabled;\n },\n\n saveNamingAnime(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAnime = values.pattern;\n postprocessing.naming.animeMultiEp = values.multiEpStyle;\n postprocessing.naming.animeNamingType = values.animeNamingType;\n postprocessing.naming.enableCustomNamingAnime = values.enabled;\n },\n\n async save() {\n const {\n postprocessing,\n metadata,\n setConfig\n } = this; // We want to wait until the page has been fully loaded, before starting to save stuff.\n\n if (!this.configLoaded) {\n return;\n } // Disable the save button until we're done.\n\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n postprocessing,\n metadata\n }); // Use destructuring to remove the unwanted keys.\n\n const {\n multiEpStrings,\n reflinkAvailable\n } = postprocessing,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(postprocessing, [\"multiEpStrings\", \"reflinkAvailable\"]); // Assign the object with the keys removed to our copied object.\n\n\n config.postProcessing = rest;\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Post-Processing config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save Post-Processing config', 'Error');\n } finally {\n this.saving = false;\n }\n },\n\n /**\n * Get the first enabled metadata provider based on enabled features.\n * @param {Object} providers - The metadata providers object.\n * @return {String} - The id of the first enabled provider.\n */\n getFirstEnabledMetadataProvider() {\n const {\n metadata\n } = this;\n const firstEnabledProvider = Object.values(metadata.metadataProviders).find(provider => {\n return provider.showMetadata || provider.episodeMetadata;\n });\n return firstEnabledProvider === undefined ? 'kodi' : firstEnabledProvider.id;\n }\n\n }),\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])(['config', 'metadata', 'postprocessing', 'system']), {\n configLoaded() {\n const {\n postprocessing\n } = this;\n return postprocessing.processAutomatically !== null;\n },\n\n multiEpStringsSelect() {\n const {\n postprocessing\n } = this;\n\n if (!postprocessing.multiEpStrings) {\n return [];\n }\n\n return Object.keys(postprocessing.multiEpStrings).map(k => ({\n value: Number(k),\n text: postprocessing.multiEpStrings[k]\n }));\n }\n\n }),\n\n beforeMount() {\n // Wait for the next tick, so the component is rendered\n this.$nextTick(() => {\n $('#config-components').tabs();\n });\n },\n\n watch: {\n 'metadata.metadataProviders': function metadataMetadataProviders(providers) {\n // eslint-disable-line object-shorthand\n const {\n getFirstEnabledMetadataProvider\n } = this;\n\n if (Object.keys(providers).length > 0) {\n this.metadataProviderSelected = getFirstEnabledMetadataProvider();\n }\n }\n }\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/config-post-processing.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-js-toggle-button */ \"./node_modules/vue-js-toggle-button/dist/index.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'config-post-processing',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"AppLink\"],\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"FileBrowser\"],\n NamePattern: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"NamePattern\"],\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"SelectList\"],\n ToggleButton: vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__[\"ToggleButton\"]\n },\n\n data() {\n return {\n presets: [{\n pattern: '%SN - %Sx%0E - %EN',\n example: 'Show Name - 2x03 - Ep Name'\n }, {\n pattern: '%S.N.S%0SE%0E.%E.N',\n example: 'Show.Name.S02E03.Ep.Name'\n }, {\n pattern: '%Sx%0E - %EN',\n example: '2x03 - Ep Name'\n }, {\n pattern: 'S%0SE%0E - %EN',\n example: 'S02E03 - Ep Name'\n }, {\n pattern: 'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG',\n example: 'Season 02/Show.Name.S02E03.720p.HDTV-RLSGROUP'\n }],\n processMethods: [{\n value: 'copy',\n text: 'Copy'\n }, {\n value: 'move',\n text: 'Move'\n }, {\n value: 'hardlink',\n text: 'Hard Link'\n }, {\n value: 'symlink',\n text: 'Symbolic Link'\n }],\n timezoneOptions: [{\n value: 'local',\n text: 'Local'\n }, {\n value: 'network',\n text: 'Network'\n }],\n metadataProviderSelected: null\n };\n },\n\n methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapActions\"])(['setConfig']), {\n onChangeSyncFiles(items) {\n const {\n postprocessing\n } = this;\n postprocessing.syncFiles = items.map(item => item.value);\n },\n\n onChangeAllowedExtensions(items) {\n const {\n postprocessing\n } = this;\n postprocessing.allowedExtensions = items.map(item => item.value);\n },\n\n onChangeExtraScripts(items) {\n const {\n postprocessing\n } = this;\n postprocessing.extraScripts = items.map(item => item.value);\n },\n\n saveNaming(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.pattern = values.pattern;\n postprocessing.naming.multiEp = values.multiEpStyle;\n },\n\n saveNamingSports(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternSports = values.pattern;\n postprocessing.naming.enableCustomNamingSports = values.enabled;\n },\n\n saveNamingAbd(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAirByDate = values.pattern;\n postprocessing.naming.enableCustomNamingAirByDate = values.enabled;\n },\n\n saveNamingAnime(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAnime = values.pattern;\n postprocessing.naming.animeMultiEp = values.multiEpStyle;\n postprocessing.naming.animeNamingType = values.animeNamingType;\n postprocessing.naming.enableCustomNamingAnime = values.enabled;\n },\n\n async save() {\n const {\n postprocessing,\n metadata,\n setConfig\n } = this; // We want to wait until the page has been fully loaded, before starting to save stuff.\n\n if (!this.configLoaded) {\n return;\n } // Disable the save button until we're done.\n\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n postProcessing: postprocessing,\n metadata\n }); // Use destructuring to remove the unwanted keys.\n\n const {\n multiEpStrings,\n reflinkAvailable,\n extraScriptsUrl\n } = postprocessing,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(postprocessing, [\"multiEpStrings\", \"reflinkAvailable\", \"extraScriptsUrl\"]); // Assign the object with the keys removed to our copied object.\n\n\n config.postProcessing = rest;\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Post-Processing config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save Post-Processing config', 'Error');\n } finally {\n this.saving = false;\n }\n },\n\n /**\n * Get the first enabled metadata provider based on enabled features.\n * @param {Object} providers - The metadata providers object.\n * @return {String} - The id of the first enabled provider.\n */\n getFirstEnabledMetadataProvider() {\n const {\n metadata\n } = this;\n const firstEnabledProvider = Object.values(metadata.metadataProviders).find(provider => {\n return provider.showMetadata || provider.episodeMetadata;\n });\n return firstEnabledProvider === undefined ? 'kodi' : firstEnabledProvider.id;\n }\n\n }),\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])(['config', 'metadata', 'postprocessing', 'system']), {\n configLoaded() {\n const {\n postprocessing\n } = this;\n return postprocessing.processAutomatically !== null;\n },\n\n multiEpStringsSelect() {\n const {\n postprocessing\n } = this;\n\n if (!postprocessing.multiEpStrings) {\n return [];\n }\n\n return Object.keys(postprocessing.multiEpStrings).map(k => ({\n value: Number(k),\n text: postprocessing.multiEpStrings[k]\n }));\n }\n\n }),\n\n beforeMount() {\n // Wait for the next tick, so the component is rendered\n this.$nextTick(() => {\n $('#config-components').tabs();\n });\n },\n\n watch: {\n 'metadata.metadataProviders': function metadataMetadataProviders(providers) {\n // eslint-disable-line object-shorthand\n const {\n getFirstEnabledMetadataProvider\n } = this;\n\n if (Object.keys(providers).length > 0) {\n this.metadataProviderSelected = getFirstEnabledMetadataProvider();\n }\n }\n }\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/config-post-processing.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), diff --git a/themes/light/assets/js/medusa-runtime.js b/themes/light/assets/js/medusa-runtime.js index 5225e4f0d9..fa9eee4885 100644 --- a/themes/light/assets/js/medusa-runtime.js +++ b/themes/light/assets/js/medusa-runtime.js @@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(f /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-js-toggle-button */ \"./node_modules/vue-js-toggle-button/dist/index.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'config-post-processing',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"AppLink\"],\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"FileBrowser\"],\n NamePattern: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"NamePattern\"],\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"SelectList\"],\n ToggleButton: vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__[\"ToggleButton\"]\n },\n\n data() {\n return {\n presets: [{\n pattern: '%SN - %Sx%0E - %EN',\n example: 'Show Name - 2x03 - Ep Name'\n }, {\n pattern: '%S.N.S%0SE%0E.%E.N',\n example: 'Show.Name.S02E03.Ep.Name'\n }, {\n pattern: '%Sx%0E - %EN',\n example: '2x03 - Ep Name'\n }, {\n pattern: 'S%0SE%0E - %EN',\n example: 'S02E03 - Ep Name'\n }, {\n pattern: 'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG',\n example: 'Season 02/Show.Name.S02E03.720p.HDTV-RLSGROUP'\n }],\n processMethods: [{\n value: 'copy',\n text: 'Copy'\n }, {\n value: 'move',\n text: 'Move'\n }, {\n value: 'hardlink',\n text: 'Hard Link'\n }, {\n value: 'symlink',\n text: 'Symbolic Link'\n }],\n timezoneOptions: [{\n value: 'local',\n text: 'Local'\n }, {\n value: 'network',\n text: 'Network'\n }],\n metadataProviderSelected: null\n };\n },\n\n methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapActions\"])(['setConfig']), {\n onChangeSyncFiles(items) {\n const {\n postprocessing\n } = this;\n postprocessing.syncFiles = items.map(item => item.value);\n },\n\n onChangeAllowedExtensions(items) {\n const {\n postprocessing\n } = this;\n postprocessing.allowedExtensions = items.map(item => item.value);\n },\n\n onChangeExtraScripts(items) {\n const {\n postprocessing\n } = this;\n postprocessing.extraScripts = items.map(item => item.value);\n },\n\n saveNaming(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.pattern = values.pattern;\n postprocessing.naming.multiEp = values.multiEpStyle;\n },\n\n saveNamingSports(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternSports = values.pattern;\n postprocessing.naming.enableCustomNamingSports = values.enabled;\n },\n\n saveNamingAbd(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAirByDate = values.pattern;\n postprocessing.naming.enableCustomNamingAirByDate = values.enabled;\n },\n\n saveNamingAnime(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAnime = values.pattern;\n postprocessing.naming.animeMultiEp = values.multiEpStyle;\n postprocessing.naming.animeNamingType = values.animeNamingType;\n postprocessing.naming.enableCustomNamingAnime = values.enabled;\n },\n\n async save() {\n const {\n postprocessing,\n metadata,\n setConfig\n } = this; // We want to wait until the page has been fully loaded, before starting to save stuff.\n\n if (!this.configLoaded) {\n return;\n } // Disable the save button until we're done.\n\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n postprocessing,\n metadata\n }); // Use destructuring to remove the unwanted keys.\n\n const {\n multiEpStrings,\n reflinkAvailable\n } = postprocessing,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(postprocessing, [\"multiEpStrings\", \"reflinkAvailable\"]); // Assign the object with the keys removed to our copied object.\n\n\n config.postProcessing = rest;\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Post-Processing config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save Post-Processing config', 'Error');\n } finally {\n this.saving = false;\n }\n },\n\n /**\n * Get the first enabled metadata provider based on enabled features.\n * @param {Object} providers - The metadata providers object.\n * @return {String} - The id of the first enabled provider.\n */\n getFirstEnabledMetadataProvider() {\n const {\n metadata\n } = this;\n const firstEnabledProvider = Object.values(metadata.metadataProviders).find(provider => {\n return provider.showMetadata || provider.episodeMetadata;\n });\n return firstEnabledProvider === undefined ? 'kodi' : firstEnabledProvider.id;\n }\n\n }),\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])(['config', 'metadata', 'postprocessing', 'system']), {\n configLoaded() {\n const {\n postprocessing\n } = this;\n return postprocessing.processAutomatically !== null;\n },\n\n multiEpStringsSelect() {\n const {\n postprocessing\n } = this;\n\n if (!postprocessing.multiEpStrings) {\n return [];\n }\n\n return Object.keys(postprocessing.multiEpStrings).map(k => ({\n value: Number(k),\n text: postprocessing.multiEpStrings[k]\n }));\n }\n\n }),\n\n beforeMount() {\n // Wait for the next tick, so the component is rendered\n this.$nextTick(() => {\n $('#config-components').tabs();\n });\n },\n\n watch: {\n 'metadata.metadataProviders': function metadataMetadataProviders(providers) {\n // eslint-disable-line object-shorthand\n const {\n getFirstEnabledMetadataProvider\n } = this;\n\n if (Object.keys(providers).length > 0) {\n this.metadataProviderSelected = getFirstEnabledMetadataProvider();\n }\n }\n }\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/config-post-processing.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-js-toggle-button */ \"./node_modules/vue-js-toggle-button/dist/index.js\");\n/* harmony import */ var vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'config-post-processing',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"AppLink\"],\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"FileBrowser\"],\n NamePattern: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"NamePattern\"],\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_4__[\"SelectList\"],\n ToggleButton: vue_js_toggle_button__WEBPACK_IMPORTED_MODULE_3__[\"ToggleButton\"]\n },\n\n data() {\n return {\n presets: [{\n pattern: '%SN - %Sx%0E - %EN',\n example: 'Show Name - 2x03 - Ep Name'\n }, {\n pattern: '%S.N.S%0SE%0E.%E.N',\n example: 'Show.Name.S02E03.Ep.Name'\n }, {\n pattern: '%Sx%0E - %EN',\n example: '2x03 - Ep Name'\n }, {\n pattern: 'S%0SE%0E - %EN',\n example: 'S02E03 - Ep Name'\n }, {\n pattern: 'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG',\n example: 'Season 02/Show.Name.S02E03.720p.HDTV-RLSGROUP'\n }],\n processMethods: [{\n value: 'copy',\n text: 'Copy'\n }, {\n value: 'move',\n text: 'Move'\n }, {\n value: 'hardlink',\n text: 'Hard Link'\n }, {\n value: 'symlink',\n text: 'Symbolic Link'\n }],\n timezoneOptions: [{\n value: 'local',\n text: 'Local'\n }, {\n value: 'network',\n text: 'Network'\n }],\n metadataProviderSelected: null\n };\n },\n\n methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapActions\"])(['setConfig']), {\n onChangeSyncFiles(items) {\n const {\n postprocessing\n } = this;\n postprocessing.syncFiles = items.map(item => item.value);\n },\n\n onChangeAllowedExtensions(items) {\n const {\n postprocessing\n } = this;\n postprocessing.allowedExtensions = items.map(item => item.value);\n },\n\n onChangeExtraScripts(items) {\n const {\n postprocessing\n } = this;\n postprocessing.extraScripts = items.map(item => item.value);\n },\n\n saveNaming(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.pattern = values.pattern;\n postprocessing.naming.multiEp = values.multiEpStyle;\n },\n\n saveNamingSports(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternSports = values.pattern;\n postprocessing.naming.enableCustomNamingSports = values.enabled;\n },\n\n saveNamingAbd(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAirByDate = values.pattern;\n postprocessing.naming.enableCustomNamingAirByDate = values.enabled;\n },\n\n saveNamingAnime(values) {\n const {\n postprocessing\n } = this;\n\n if (!this.configLoaded) {\n return;\n }\n\n postprocessing.naming.patternAnime = values.pattern;\n postprocessing.naming.animeMultiEp = values.multiEpStyle;\n postprocessing.naming.animeNamingType = values.animeNamingType;\n postprocessing.naming.enableCustomNamingAnime = values.enabled;\n },\n\n async save() {\n const {\n postprocessing,\n metadata,\n setConfig\n } = this; // We want to wait until the page has been fully loaded, before starting to save stuff.\n\n if (!this.configLoaded) {\n return;\n } // Disable the save button until we're done.\n\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n postProcessing: postprocessing,\n metadata\n }); // Use destructuring to remove the unwanted keys.\n\n const {\n multiEpStrings,\n reflinkAvailable,\n extraScriptsUrl\n } = postprocessing,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(postprocessing, [\"multiEpStrings\", \"reflinkAvailable\", \"extraScriptsUrl\"]); // Assign the object with the keys removed to our copied object.\n\n\n config.postProcessing = rest;\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Post-Processing config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save Post-Processing config', 'Error');\n } finally {\n this.saving = false;\n }\n },\n\n /**\n * Get the first enabled metadata provider based on enabled features.\n * @param {Object} providers - The metadata providers object.\n * @return {String} - The id of the first enabled provider.\n */\n getFirstEnabledMetadataProvider() {\n const {\n metadata\n } = this;\n const firstEnabledProvider = Object.values(metadata.metadataProviders).find(provider => {\n return provider.showMetadata || provider.episodeMetadata;\n });\n return firstEnabledProvider === undefined ? 'kodi' : firstEnabledProvider.id;\n }\n\n }),\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])(['config', 'metadata', 'postprocessing', 'system']), {\n configLoaded() {\n const {\n postprocessing\n } = this;\n return postprocessing.processAutomatically !== null;\n },\n\n multiEpStringsSelect() {\n const {\n postprocessing\n } = this;\n\n if (!postprocessing.multiEpStrings) {\n return [];\n }\n\n return Object.keys(postprocessing.multiEpStrings).map(k => ({\n value: Number(k),\n text: postprocessing.multiEpStrings[k]\n }));\n }\n\n }),\n\n beforeMount() {\n // Wait for the next tick, so the component is rendered\n this.$nextTick(() => {\n $('#config-components').tabs();\n });\n },\n\n watch: {\n 'metadata.metadataProviders': function metadataMetadataProviders(providers) {\n // eslint-disable-line object-shorthand\n const {\n getFirstEnabledMetadataProvider\n } = this;\n\n if (Object.keys(providers).length > 0) {\n this.metadataProviderSelected = getFirstEnabledMetadataProvider();\n }\n }\n }\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/config-post-processing.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }),