diff --git a/medusa/clients/torrent/deluge.py b/medusa/clients/torrent/deluge.py index ebec803aa3..ae859ebe35 100644 --- a/medusa/clients/torrent/deluge.py +++ b/medusa/clients/torrent/deluge.py @@ -106,7 +106,7 @@ def read_torrent_status(torrent_data): class DelugeAPI(GenericClient): """Deluge API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Constructor. :param host: @@ -116,7 +116,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(DelugeAPI, self).__init__('Deluge', host, username, password) + super(DelugeAPI, self).__init__('Deluge', host, username, password, torrent_path) self.session.headers.update({'Content-Type': 'application/json'}) self.url = urljoin(self.host, 'json') diff --git a/medusa/clients/torrent/deluged.py b/medusa/clients/torrent/deluged.py index ae9eb13422..a78dd26f19 100644 --- a/medusa/clients/torrent/deluged.py +++ b/medusa/clients/torrent/deluged.py @@ -28,7 +28,7 @@ class DelugeDAPI(GenericClient): """Deluge Daemon API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Deluge deamon Constructor. :param host: @@ -38,7 +38,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(DelugeDAPI, self).__init__('DelugeD', host, username, password) + super(DelugeDAPI, self).__init__('DelugeD', host, username, password, torrent_path) self.drpc = None self._get_auth() diff --git a/medusa/clients/torrent/mlnet.py b/medusa/clients/torrent/mlnet.py index 95d4554547..6e8342191d 100644 --- a/medusa/clients/torrent/mlnet.py +++ b/medusa/clients/torrent/mlnet.py @@ -10,7 +10,7 @@ class MLNetAPI(GenericClient): """MLDonkey API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Constructor. :param host: @@ -20,7 +20,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(MLNetAPI, self).__init__('mlnet', host, username, password) + super(MLNetAPI, self).__init__('mlnet', host, username, password, torrent_path) self.url = self.host # self.session.auth = HTTPDigestAuth(self.username, self.password); diff --git a/medusa/clients/torrent/qbittorrent.py b/medusa/clients/torrent/qbittorrent.py index 394790c74c..e361ec87fa 100644 --- a/medusa/clients/torrent/qbittorrent.py +++ b/medusa/clients/torrent/qbittorrent.py @@ -29,7 +29,7 @@ class APIUnavailableError(Exception): class QBittorrentAPI(GenericClient): """qBittorrent API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Constructor. :param host: @@ -39,7 +39,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(QBittorrentAPI, self).__init__('qBittorrent', host, username, password) + super(QBittorrentAPI, self).__init__('qBittorrent', host, username, password, torrent_path) self.url = self.host # Auth for API v1.0.0 (qBittorrent v3.1.x and older) self.session.auth = HTTPDigestAuth(self.username, self.password) diff --git a/medusa/clients/torrent/rtorrent.py b/medusa/clients/torrent/rtorrent.py index a249ee1ec7..bfa9d3b4bf 100644 --- a/medusa/clients/torrent/rtorrent.py +++ b/medusa/clients/torrent/rtorrent.py @@ -21,7 +21,7 @@ class RTorrentAPI(GenericClient): """rTorrent API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Constructor. :param host: @@ -31,7 +31,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(RTorrentAPI, self).__init__('rTorrent', host, username, password) + super(RTorrentAPI, self).__init__('rTorrent', host, username, password, torrent_path) self._get_auth() def _get_auth(self): diff --git a/medusa/clients/torrent/transmission.py b/medusa/clients/torrent/transmission.py index ed8545948e..ef4a14242c 100644 --- a/medusa/clients/torrent/transmission.py +++ b/medusa/clients/torrent/transmission.py @@ -26,7 +26,7 @@ class TransmissionAPI(GenericClient): """Transmission API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Transmission constructor. :param host: diff --git a/medusa/clients/torrent/utorrent.py b/medusa/clients/torrent/utorrent.py index ecd43f5728..2e9bb135eb 100644 --- a/medusa/clients/torrent/utorrent.py +++ b/medusa/clients/torrent/utorrent.py @@ -52,7 +52,7 @@ def get_torrent_subfolder(result): class UTorrentAPI(GenericClient): """uTorrent API class.""" - def __init__(self, host=None, username=None, password=None): + def __init__(self, host=None, username=None, password=None, torrent_path=None): """Utorrent constructor. :param host: @@ -62,7 +62,7 @@ def __init__(self, host=None, username=None, password=None): :param password: :type password: string """ - super(UTorrentAPI, self).__init__('uTorrent', host, username, password) + super(UTorrentAPI, self).__init__('uTorrent', host, username, password, torrent_path) self.url = urljoin(self.host, 'gui/') self._torrents_list = [] self._torrents_epoch = 0.0 diff --git a/medusa/server/web/home/handler.py b/medusa/server/web/home/handler.py index c0787484fd..3facc1dd5b 100644 --- a/medusa/server/web/home/handler.py +++ b/medusa/server/web/home/handler.py @@ -222,14 +222,14 @@ def testNZBget(host=None, username=None, password=None, use_https=False): return 'Unable to connect to host' @staticmethod - def testTorrent(torrent_method=None, host=None, username=None, password=None): + def testTorrent(torrent_method=None, host=None, username=None, password=None, torrent_path=None): # @TODO: Move this to the validation section of each PATCH/PUT method for torrents host = config.clean_url(host) try: client = torrent.get_client_class(torrent_method) - _, acces_msg = client(host, username, password).test_authentication() + _, acces_msg = client(host, username, password, torrent_path).test_authentication() except Exception as error: logger.log('Error while testing {torrent} connection: {error}'.format( torrent=torrent_method or 'torrent', error=error), logger.WARNING) diff --git a/themes-default/slim/src/components/config-search.vue b/themes-default/slim/src/components/config-search.vue index 0e3d5c6c4f..d2e9334d11 100644 --- a/themes-default/slim/src/components/config-search.vue +++ b/themes-default/slim/src/components/config-search.vue @@ -571,7 +571,7 @@ export default { async testTorrentClient() { const { clients } = this; const { torrents } = clients; - const { method, host, username, password } = torrents; + const { method, host, username, password, path } = torrents; this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading; @@ -579,7 +579,8 @@ export default { torrent_method: method, // eslint-disable-line camelcase host, username, - password + password, + torrent_path: path // eslint-disable-line camelcase }; const resp = await apiRoute.get('home/testTorrent', { params }); diff --git a/themes/dark/assets/js/medusa-runtime.js b/themes/dark/assets/js/medusa-runtime.js index 4d0513da90..f0e27ef917 100644 --- a/themes/dark/assets/js/medusa-runtime.js +++ b/themes/dark/assets/js/medusa-runtime.js @@ -147,7 +147,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api.js */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'config-search',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_1__.AppLink,\n ConfigTemplate: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTemplate,\n ConfigTextbox: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextbox,\n ConfigTextboxNumber: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextboxNumber,\n ConfigToggleSlider: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigToggleSlider,\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_1__.FileBrowser,\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_1__.SelectList\n },\n\n data() {\n return {\n configLoaded: false,\n checkPropersIntervalLabels: [{\n text: '24 hours',\n value: 'daily'\n }, {\n text: '4 hours',\n value: '4h'\n }, {\n text: '90 mins',\n value: '90m'\n }, {\n text: '45 mins',\n value: '45m'\n }, {\n text: '30 mins',\n value: '30m'\n }, {\n text: '15 mins',\n value: '15m'\n }],\n nzbGetPriorityOptions: [{\n text: 'Very low',\n value: -100\n }, {\n text: 'Low',\n value: -50\n }, {\n text: 'Normal',\n value: 0\n }, {\n text: 'High',\n value: 50\n }, {\n text: 'Very high',\n value: 100\n }, {\n text: 'Force',\n value: 900\n }],\n // Static clients config\n clientsConfig: {\n torrent: {\n blackhole: {\n title: 'Black hole'\n },\n utorrent: {\n title: 'uTorrent',\n description: 'URL to your uTorrent client (e.g. http://localhost:8000)',\n labelOption: true,\n labelAnimeOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n transmission: {\n title: 'Transmission',\n description: 'URL to your Transmission client (e.g. http://localhost:9091)',\n pathOption: true,\n removeFromClientOption: true,\n seedLocationOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n deluge: {\n title: 'Deluge (via WebUI)',\n shortTitle: 'Deluge',\n description: 'URL to your Deluge client (e.g. http://localhost:8112)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n deluged: {\n title: 'Deluge (via Daemon)',\n shortTitle: 'Deluge',\n description: 'IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n downloadstation: {\n title: 'Synology DS',\n description: 'URL to your Synology DS client (e.g. http://localhost:5000)',\n pathOption: true,\n testStatus: 'Click below to test'\n },\n rtorrent: {\n title: 'rTorrent',\n description: 'URL to your rTorrent client (e.g. scgi://localhost:5000
or https://localhost/rutorrent/plugins/httprpc/action.php)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n qbittorrent: {\n title: 'qBittorrent',\n description: 'URL to your qBittorrent client (e.g. http://localhost:8080)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n mlnet: {\n title: 'MLDonkey',\n description: 'URL to your MLDonkey (e.g. http://localhost:4080)',\n verifySSLOption: true,\n testStatus: 'Click below to test'\n }\n },\n nzb: {\n blackhole: {\n title: 'Black hole'\n },\n nzbget: {\n title: 'NZBget',\n description: 'NZBget RPC host name and port number (not NZBgetweb!) (e.g. localhost:6789)',\n testStatus: 'Click below to test'\n },\n sabnzbd: {\n title: 'SABnzbd',\n description: 'URL to your SABnzbd server (e.g. http://localhost:8080/)',\n testStatus: 'Click below to test'\n }\n }\n },\n httpAuthTypes: {\n none: 'None',\n basic: 'Basic',\n digest: 'Digest'\n },\n saving: false\n };\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapState)({\n clients: state => state.config.clients,\n search: state => state.config.search,\n system: state => state.config.system\n }),\n\n torrentUsernameIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (!['rtorrent', 'deluge'].includes(method) || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n torrentPasswordIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method !== 'rtorrent' || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n authTypeIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\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 methods: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapActions)(['setConfig']),\n\n async testTorrentClient() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method,\n host,\n username,\n password\n } = torrents;\n this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading;\n const params = {\n torrent_method: method,\n // eslint-disable-line camelcase\n host,\n username,\n password\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testTorrent', {\n params\n });\n this.clientsConfig.torrent[method].testStatus = resp.data;\n },\n\n async testNzbget() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n nzbget\n } = nzb;\n const {\n host,\n username,\n password,\n useHttps\n } = nzbget;\n this.clientsConfig.nzb.nzbget.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n use_https: useHttps // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testNZBget', {\n params\n });\n this.clientsConfig.nzb.nzbget.testStatus = resp.data;\n },\n\n async testSabnzbd() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n sabnzbd\n } = nzb;\n const {\n host,\n username,\n password,\n apiKey\n } = sabnzbd;\n this.clientsConfig.nzb.sabnzbd.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n apikey: apiKey\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testSABnzbd', {\n params\n });\n this.clientsConfig.nzb.sabnzbd.testStatus = resp.data;\n },\n\n async save() {\n const {\n clients,\n search,\n setConfig\n } = this; // Disable the save button until we're done.\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n search\n }, {\n clients\n });\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Search config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save search config', 'Error');\n } finally {\n this.saving = false;\n }\n }\n\n },\n watch: {\n 'clients.torrents.host'(host) {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method\n } = torrents;\n\n if (method === 'rtorrent') {\n if (!host) {\n return;\n }\n\n const isMatch = host.startsWith('scgi://');\n\n if (isMatch) {\n this.clients.torrents.username = '';\n this.clients.torrents.password = '';\n this.clients.torrents.authType = 'none';\n }\n }\n\n if (method === 'deluge') {\n this.clients.torrents.username = '';\n }\n },\n\n 'clients.torrents.method'(method) {\n if (!this.clientsConfig.torrent[method].removeFromClientOption) {\n this.search.general.removeFromClient = false;\n }\n }\n\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/config-search.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api.js */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'config-search',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_1__.AppLink,\n ConfigTemplate: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTemplate,\n ConfigTextbox: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextbox,\n ConfigTextboxNumber: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextboxNumber,\n ConfigToggleSlider: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigToggleSlider,\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_1__.FileBrowser,\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_1__.SelectList\n },\n\n data() {\n return {\n configLoaded: false,\n checkPropersIntervalLabels: [{\n text: '24 hours',\n value: 'daily'\n }, {\n text: '4 hours',\n value: '4h'\n }, {\n text: '90 mins',\n value: '90m'\n }, {\n text: '45 mins',\n value: '45m'\n }, {\n text: '30 mins',\n value: '30m'\n }, {\n text: '15 mins',\n value: '15m'\n }],\n nzbGetPriorityOptions: [{\n text: 'Very low',\n value: -100\n }, {\n text: 'Low',\n value: -50\n }, {\n text: 'Normal',\n value: 0\n }, {\n text: 'High',\n value: 50\n }, {\n text: 'Very high',\n value: 100\n }, {\n text: 'Force',\n value: 900\n }],\n // Static clients config\n clientsConfig: {\n torrent: {\n blackhole: {\n title: 'Black hole'\n },\n utorrent: {\n title: 'uTorrent',\n description: 'URL to your uTorrent client (e.g. http://localhost:8000)',\n labelOption: true,\n labelAnimeOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n transmission: {\n title: 'Transmission',\n description: 'URL to your Transmission client (e.g. http://localhost:9091)',\n pathOption: true,\n removeFromClientOption: true,\n seedLocationOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n deluge: {\n title: 'Deluge (via WebUI)',\n shortTitle: 'Deluge',\n description: 'URL to your Deluge client (e.g. http://localhost:8112)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n deluged: {\n title: 'Deluge (via Daemon)',\n shortTitle: 'Deluge',\n description: 'IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n downloadstation: {\n title: 'Synology DS',\n description: 'URL to your Synology DS client (e.g. http://localhost:5000)',\n pathOption: true,\n testStatus: 'Click below to test'\n },\n rtorrent: {\n title: 'rTorrent',\n description: 'URL to your rTorrent client (e.g. scgi://localhost:5000
or https://localhost/rutorrent/plugins/httprpc/action.php)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n qbittorrent: {\n title: 'qBittorrent',\n description: 'URL to your qBittorrent client (e.g. http://localhost:8080)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n mlnet: {\n title: 'MLDonkey',\n description: 'URL to your MLDonkey (e.g. http://localhost:4080)',\n verifySSLOption: true,\n testStatus: 'Click below to test'\n }\n },\n nzb: {\n blackhole: {\n title: 'Black hole'\n },\n nzbget: {\n title: 'NZBget',\n description: 'NZBget RPC host name and port number (not NZBgetweb!) (e.g. localhost:6789)',\n testStatus: 'Click below to test'\n },\n sabnzbd: {\n title: 'SABnzbd',\n description: 'URL to your SABnzbd server (e.g. http://localhost:8080/)',\n testStatus: 'Click below to test'\n }\n }\n },\n httpAuthTypes: {\n none: 'None',\n basic: 'Basic',\n digest: 'Digest'\n },\n saving: false\n };\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapState)({\n clients: state => state.config.clients,\n search: state => state.config.search,\n system: state => state.config.system\n }),\n\n torrentUsernameIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (!['rtorrent', 'deluge'].includes(method) || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n torrentPasswordIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method !== 'rtorrent' || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n authTypeIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\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 methods: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapActions)(['setConfig']),\n\n async testTorrentClient() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method,\n host,\n username,\n password,\n path\n } = torrents;\n this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading;\n const params = {\n torrent_method: method,\n // eslint-disable-line camelcase\n host,\n username,\n password,\n torrent_path: path // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testTorrent', {\n params\n });\n this.clientsConfig.torrent[method].testStatus = resp.data;\n },\n\n async testNzbget() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n nzbget\n } = nzb;\n const {\n host,\n username,\n password,\n useHttps\n } = nzbget;\n this.clientsConfig.nzb.nzbget.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n use_https: useHttps // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testNZBget', {\n params\n });\n this.clientsConfig.nzb.nzbget.testStatus = resp.data;\n },\n\n async testSabnzbd() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n sabnzbd\n } = nzb;\n const {\n host,\n username,\n password,\n apiKey\n } = sabnzbd;\n this.clientsConfig.nzb.sabnzbd.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n apikey: apiKey\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testSABnzbd', {\n params\n });\n this.clientsConfig.nzb.sabnzbd.testStatus = resp.data;\n },\n\n async save() {\n const {\n clients,\n search,\n setConfig\n } = this; // Disable the save button until we're done.\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n search\n }, {\n clients\n });\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Search config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save search config', 'Error');\n } finally {\n this.saving = false;\n }\n }\n\n },\n watch: {\n 'clients.torrents.host'(host) {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method\n } = torrents;\n\n if (method === 'rtorrent') {\n if (!host) {\n return;\n }\n\n const isMatch = host.startsWith('scgi://');\n\n if (isMatch) {\n this.clients.torrents.username = '';\n this.clients.torrents.password = '';\n this.clients.torrents.authType = 'none';\n }\n }\n\n if (method === 'deluge') {\n this.clients.torrents.username = '';\n }\n },\n\n 'clients.torrents.method'(method) {\n if (!this.clientsConfig.torrent[method].removeFromClientOption) {\n this.search.general.removeFromClient = false;\n }\n }\n\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/config-search.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), diff --git a/themes/light/assets/js/medusa-runtime.js b/themes/light/assets/js/medusa-runtime.js index 4d0513da90..f0e27ef917 100644 --- a/themes/light/assets/js/medusa-runtime.js +++ b/themes/light/assets/js/medusa-runtime.js @@ -147,7 +147,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api.js */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'config-search',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_1__.AppLink,\n ConfigTemplate: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTemplate,\n ConfigTextbox: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextbox,\n ConfigTextboxNumber: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextboxNumber,\n ConfigToggleSlider: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigToggleSlider,\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_1__.FileBrowser,\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_1__.SelectList\n },\n\n data() {\n return {\n configLoaded: false,\n checkPropersIntervalLabels: [{\n text: '24 hours',\n value: 'daily'\n }, {\n text: '4 hours',\n value: '4h'\n }, {\n text: '90 mins',\n value: '90m'\n }, {\n text: '45 mins',\n value: '45m'\n }, {\n text: '30 mins',\n value: '30m'\n }, {\n text: '15 mins',\n value: '15m'\n }],\n nzbGetPriorityOptions: [{\n text: 'Very low',\n value: -100\n }, {\n text: 'Low',\n value: -50\n }, {\n text: 'Normal',\n value: 0\n }, {\n text: 'High',\n value: 50\n }, {\n text: 'Very high',\n value: 100\n }, {\n text: 'Force',\n value: 900\n }],\n // Static clients config\n clientsConfig: {\n torrent: {\n blackhole: {\n title: 'Black hole'\n },\n utorrent: {\n title: 'uTorrent',\n description: 'URL to your uTorrent client (e.g. http://localhost:8000)',\n labelOption: true,\n labelAnimeOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n transmission: {\n title: 'Transmission',\n description: 'URL to your Transmission client (e.g. http://localhost:9091)',\n pathOption: true,\n removeFromClientOption: true,\n seedLocationOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n deluge: {\n title: 'Deluge (via WebUI)',\n shortTitle: 'Deluge',\n description: 'URL to your Deluge client (e.g. http://localhost:8112)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n deluged: {\n title: 'Deluge (via Daemon)',\n shortTitle: 'Deluge',\n description: 'IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n downloadstation: {\n title: 'Synology DS',\n description: 'URL to your Synology DS client (e.g. http://localhost:5000)',\n pathOption: true,\n testStatus: 'Click below to test'\n },\n rtorrent: {\n title: 'rTorrent',\n description: 'URL to your rTorrent client (e.g. scgi://localhost:5000
or https://localhost/rutorrent/plugins/httprpc/action.php)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n qbittorrent: {\n title: 'qBittorrent',\n description: 'URL to your qBittorrent client (e.g. http://localhost:8080)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n mlnet: {\n title: 'MLDonkey',\n description: 'URL to your MLDonkey (e.g. http://localhost:4080)',\n verifySSLOption: true,\n testStatus: 'Click below to test'\n }\n },\n nzb: {\n blackhole: {\n title: 'Black hole'\n },\n nzbget: {\n title: 'NZBget',\n description: 'NZBget RPC host name and port number (not NZBgetweb!) (e.g. localhost:6789)',\n testStatus: 'Click below to test'\n },\n sabnzbd: {\n title: 'SABnzbd',\n description: 'URL to your SABnzbd server (e.g. http://localhost:8080/)',\n testStatus: 'Click below to test'\n }\n }\n },\n httpAuthTypes: {\n none: 'None',\n basic: 'Basic',\n digest: 'Digest'\n },\n saving: false\n };\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapState)({\n clients: state => state.config.clients,\n search: state => state.config.search,\n system: state => state.config.system\n }),\n\n torrentUsernameIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (!['rtorrent', 'deluge'].includes(method) || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n torrentPasswordIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method !== 'rtorrent' || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n authTypeIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\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 methods: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapActions)(['setConfig']),\n\n async testTorrentClient() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method,\n host,\n username,\n password\n } = torrents;\n this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading;\n const params = {\n torrent_method: method,\n // eslint-disable-line camelcase\n host,\n username,\n password\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testTorrent', {\n params\n });\n this.clientsConfig.torrent[method].testStatus = resp.data;\n },\n\n async testNzbget() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n nzbget\n } = nzb;\n const {\n host,\n username,\n password,\n useHttps\n } = nzbget;\n this.clientsConfig.nzb.nzbget.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n use_https: useHttps // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testNZBget', {\n params\n });\n this.clientsConfig.nzb.nzbget.testStatus = resp.data;\n },\n\n async testSabnzbd() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n sabnzbd\n } = nzb;\n const {\n host,\n username,\n password,\n apiKey\n } = sabnzbd;\n this.clientsConfig.nzb.sabnzbd.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n apikey: apiKey\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testSABnzbd', {\n params\n });\n this.clientsConfig.nzb.sabnzbd.testStatus = resp.data;\n },\n\n async save() {\n const {\n clients,\n search,\n setConfig\n } = this; // Disable the save button until we're done.\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n search\n }, {\n clients\n });\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Search config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save search config', 'Error');\n } finally {\n this.saving = false;\n }\n }\n\n },\n watch: {\n 'clients.torrents.host'(host) {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method\n } = torrents;\n\n if (method === 'rtorrent') {\n if (!host) {\n return;\n }\n\n const isMatch = host.startsWith('scgi://');\n\n if (isMatch) {\n this.clients.torrents.username = '';\n this.clients.torrents.password = '';\n this.clients.torrents.authType = 'none';\n }\n }\n\n if (method === 'deluge') {\n this.clients.torrents.username = '';\n }\n },\n\n 'clients.torrents.method'(method) {\n if (!this.clientsConfig.torrent[method].removeFromClientOption) {\n this.search.general.removeFromClient = false;\n }\n }\n\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/config-search.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api.js */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'config-search',\n components: {\n AppLink: _helpers__WEBPACK_IMPORTED_MODULE_1__.AppLink,\n ConfigTemplate: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTemplate,\n ConfigTextbox: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextbox,\n ConfigTextboxNumber: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigTextboxNumber,\n ConfigToggleSlider: _helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigToggleSlider,\n FileBrowser: _helpers__WEBPACK_IMPORTED_MODULE_1__.FileBrowser,\n SelectList: _helpers__WEBPACK_IMPORTED_MODULE_1__.SelectList\n },\n\n data() {\n return {\n configLoaded: false,\n checkPropersIntervalLabels: [{\n text: '24 hours',\n value: 'daily'\n }, {\n text: '4 hours',\n value: '4h'\n }, {\n text: '90 mins',\n value: '90m'\n }, {\n text: '45 mins',\n value: '45m'\n }, {\n text: '30 mins',\n value: '30m'\n }, {\n text: '15 mins',\n value: '15m'\n }],\n nzbGetPriorityOptions: [{\n text: 'Very low',\n value: -100\n }, {\n text: 'Low',\n value: -50\n }, {\n text: 'Normal',\n value: 0\n }, {\n text: 'High',\n value: 50\n }, {\n text: 'Very high',\n value: 100\n }, {\n text: 'Force',\n value: 900\n }],\n // Static clients config\n clientsConfig: {\n torrent: {\n blackhole: {\n title: 'Black hole'\n },\n utorrent: {\n title: 'uTorrent',\n description: 'URL to your uTorrent client (e.g. http://localhost:8000)',\n labelOption: true,\n labelAnimeOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n transmission: {\n title: 'Transmission',\n description: 'URL to your Transmission client (e.g. http://localhost:9091)',\n pathOption: true,\n removeFromClientOption: true,\n seedLocationOption: true,\n seedTimeOption: true,\n pausedOption: true,\n testStatus: 'Click below to test'\n },\n deluge: {\n title: 'Deluge (via WebUI)',\n shortTitle: 'Deluge',\n description: 'URL to your Deluge client (e.g. http://localhost:8112)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n deluged: {\n title: 'Deluge (via Daemon)',\n shortTitle: 'Deluge',\n description: 'IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)',\n pathOption: true,\n removeFromClientOption: true,\n labelOption: true,\n labelAnimeOption: true,\n seedLocationOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n downloadstation: {\n title: 'Synology DS',\n description: 'URL to your Synology DS client (e.g. http://localhost:5000)',\n pathOption: true,\n testStatus: 'Click below to test'\n },\n rtorrent: {\n title: 'rTorrent',\n description: 'URL to your rTorrent client (e.g. scgi://localhost:5000
or https://localhost/rutorrent/plugins/httprpc/action.php)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n qbittorrent: {\n title: 'qBittorrent',\n description: 'URL to your qBittorrent client (e.g. http://localhost:8080)',\n pathOption: true,\n labelOption: true,\n labelAnimeOption: true,\n pausedOption: true,\n verifySSLOption: true,\n testStatus: 'Click below to test'\n },\n mlnet: {\n title: 'MLDonkey',\n description: 'URL to your MLDonkey (e.g. http://localhost:4080)',\n verifySSLOption: true,\n testStatus: 'Click below to test'\n }\n },\n nzb: {\n blackhole: {\n title: 'Black hole'\n },\n nzbget: {\n title: 'NZBget',\n description: 'NZBget RPC host name and port number (not NZBgetweb!) (e.g. localhost:6789)',\n testStatus: 'Click below to test'\n },\n sabnzbd: {\n title: 'SABnzbd',\n description: 'URL to your SABnzbd server (e.g. http://localhost:8080/)',\n testStatus: 'Click below to test'\n }\n }\n },\n httpAuthTypes: {\n none: 'None',\n basic: 'Basic',\n digest: 'Digest'\n },\n saving: false\n };\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapState)({\n clients: state => state.config.clients,\n search: state => state.config.search,\n system: state => state.config.system\n }),\n\n torrentUsernameIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (!['rtorrent', 'deluge'].includes(method) || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n torrentPasswordIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method !== 'rtorrent' || method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\n },\n\n authTypeIsDisabled() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n host,\n method\n } = torrents;\n const torrentHost = host || '';\n\n if (method === 'rtorrent' && !torrentHost.startsWith('scgi://')) {\n return false;\n }\n\n return true;\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 methods: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_2__.mapActions)(['setConfig']),\n\n async testTorrentClient() {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method,\n host,\n username,\n password,\n path\n } = torrents;\n this.clientsConfig.torrent[method].testStatus = MEDUSA.config.layout.loading;\n const params = {\n torrent_method: method,\n // eslint-disable-line camelcase\n host,\n username,\n password,\n torrent_path: path // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testTorrent', {\n params\n });\n this.clientsConfig.torrent[method].testStatus = resp.data;\n },\n\n async testNzbget() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n nzbget\n } = nzb;\n const {\n host,\n username,\n password,\n useHttps\n } = nzbget;\n this.clientsConfig.nzb.nzbget.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n use_https: useHttps // eslint-disable-line camelcase\n\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testNZBget', {\n params\n });\n this.clientsConfig.nzb.nzbget.testStatus = resp.data;\n },\n\n async testSabnzbd() {\n const {\n clients\n } = this;\n const {\n nzb\n } = clients;\n const {\n sabnzbd\n } = nzb;\n const {\n host,\n username,\n password,\n apiKey\n } = sabnzbd;\n this.clientsConfig.nzb.sabnzbd.testStatus = MEDUSA.config.layout.loading;\n const params = {\n host,\n username,\n password,\n apikey: apiKey\n };\n const resp = await _api_js__WEBPACK_IMPORTED_MODULE_0__.apiRoute.get('home/testSABnzbd', {\n params\n });\n this.clientsConfig.nzb.sabnzbd.testStatus = resp.data;\n },\n\n async save() {\n const {\n clients,\n search,\n setConfig\n } = this; // Disable the save button until we're done.\n\n this.saving = true; // Clone the config into a new object\n\n const config = Object.assign({}, {\n search\n }, {\n clients\n });\n const section = 'main';\n\n try {\n await setConfig({\n section,\n config\n });\n this.$snotify.success('Saved Search config', 'Saved', {\n timeout: 5000\n });\n } catch (error) {\n this.$snotify.error('Error while trying to save search config', 'Error');\n } finally {\n this.saving = false;\n }\n }\n\n },\n watch: {\n 'clients.torrents.host'(host) {\n const {\n clients\n } = this;\n const {\n torrents\n } = clients;\n const {\n method\n } = torrents;\n\n if (method === 'rtorrent') {\n if (!host) {\n return;\n }\n\n const isMatch = host.startsWith('scgi://');\n\n if (isMatch) {\n this.clients.torrents.username = '';\n this.clients.torrents.password = '';\n this.clients.torrents.authType = 'none';\n }\n }\n\n if (method === 'deluge') {\n this.clients.torrents.username = '';\n }\n },\n\n 'clients.torrents.method'(method) {\n if (!this.clientsConfig.torrent[method].removeFromClientOption) {\n this.search.general.removeFromClient = false;\n }\n }\n\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/config-search.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }),