diff --git a/CHANGELOG.md b/CHANGELOG.md index 45d837b55f..aaa1e63ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 0.3.9 (2019-12-12) + +#### Improvements +- Improved qBittorrent client ([#7474](https://github.com/pymedusa/Medusa/pull/7474)) + +#### Fixes +- Fixed season pack downloads occurring even if not needed ([#7472](https://github.com/pymedusa/Medusa/pull/7472)) +- Fixed changing default indexer language and initial indexer in config-general ([#7478](https://github.com/pymedusa/Medusa/pull/7478)) + +----- + ## 0.3.8 (2019-12-08) #### Improvements @@ -6,7 +17,6 @@ - Improve a number of anime release names parsed by guessit ([#7418](https://github.com/pymedusa/Medusa/pull/7418)) ([#7396](https://github.com/pymedusa/Medusa/pull/7396)) ([#7427](https://github.com/pymedusa/Medusa/pull/7427)) #### Fixes - - Show Header: Fix showing correct amount of stars for the IMDB rating ([#7401](https://github.com/pymedusa/Medusa/pull/7401)) - Re-implement tvdb season poster/banners (was disabled because of tvdb api issues) ([#7460](https://github.com/pymedusa/Medusa/pull/7460)) - Fix showing the data directory in the bottom of some config pages ([#7424](https://github.com/pymedusa/Medusa/pull/7424)) @@ -60,7 +70,7 @@ - Converted the footer to a Vue component ([#4520](https://github.com/pymedusa/Medusa/pull/4520)) - Converted Edit Show to a Vue SFC ([#4486](https://github.com/pymedusa/Medusa/pull/4486) - Improved API v2 exception reporting on Python 2 ([#6931](https://github.com/pymedusa/Medusa/pull/6931)) -- Added support for qbittorrent api v2. Required from qbittorrent version > 3.2.0. ([#7040](https://github.com/pymedusa/Medusa/pull/7040)) +- Added support for qBittorrent API v2. Required from qBittorrent version 4.2.0. ([#7040](https://github.com/pymedusa/Medusa/pull/7040)) - Removed the forced search queue item in favor of the backlog search queue item. ([#6718](https://github.com/pymedusa/Medusa/pull/6718)) - Show Header: Improved visibility of local and global configured required and ignored words. ([#7085](https://github.com/pymedusa/Medusa/pull/7085)) - Reduced frequency of file system access when not strictly required ([#7102](https://github.com/pymedusa/Medusa/pull/7102)) diff --git a/medusa/classes.py b/medusa/classes.py index 13ea5276fd..bd2b865902 100644 --- a/medusa/classes.py +++ b/medusa/classes.py @@ -220,8 +220,14 @@ def _create_episode_objects(self): if self.actual_season is not None and self.series: if self.actual_episodes: self.episodes = [self.series.get_episode(self.actual_season, ep) for ep in self.actual_episodes] + if len(self.actual_episodes) == 1: + self.episode_number = self.actual_episodes[0] + else: + self.episode_number = MULTI_EP_RESULT else: self.episodes = self.series.get_all_episodes(self.actual_season) + self.actual_episodes = [ep.episode for ep in self.episodes] + self.episode_number = SEASON_RESULT return self.episodes @@ -245,12 +251,6 @@ def _episodes_from_cache(self): # Season result if not sql_episodes: ep_objs = series_obj.get_all_episodes(actual_season) - if not ep_objs: - # We couldn't get any episodes for this season, which is odd, skip the result. - log.debug("We couldn't get any episodes for season {0} of {1}, skipping", - actual_season, cached_data['name']) - return - self.actual_episodes = [ep.episode for ep in ep_objs] self.episode_number = SEASON_RESULT diff --git a/medusa/clients/torrent/qbittorrent.py b/medusa/clients/torrent/qbittorrent.py index a77a8371f5..41d215e61c 100644 --- a/medusa/clients/torrent/qbittorrent.py +++ b/medusa/clients/torrent/qbittorrent.py @@ -11,11 +11,16 @@ from medusa.logger.adapters.style import BraceAdapter from requests.auth import HTTPDigestAuth +from requests.compat import urljoin log = BraceAdapter(logging.getLogger(__name__)) log.logger.addHandler(logging.NullHandler()) +class APIUnavailableError(Exception): + """Raised when the API version is not available.""" + + class QBittorrentAPI(GenericClient): """qBittorrent API class.""" @@ -29,47 +34,54 @@ 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) self.url = self.host + # Auth for API v1.0.0 (qBittorrent v3.1.x and older) self.session.auth = HTTPDigestAuth(self.username, self.password) - @property - def api(self): - """Get API version.""" - # Update the auth method to v2 - self._get_auth = self._get_auth_v2 - # Attempt to get API v2 version first - self.url = '{host}api/v2/app/webapiVersion'.format(host=self.host) - try: - version = self.session.get(self.url, verify=app.TORRENT_VERIFY_CERT, - cookies=self.session.cookies) - # Make sure version is using the (major, minor, release) format - version = list(map(int, version.text.split('.'))) - if len(version) < 2: - version.append(0) - return tuple(version) - except (AttributeError, ValueError) as error: - log.error('{name}: Unable to get API version. Error: {error!r}', - {'name': self.name, 'error': error}) - - # Fall back to API v1 - self._get_auth = self._get_auth_legacy - try: - self.url = '{host}version/api'.format(host=self.host) - version = int(self.session.get(self.url, verify=app.TORRENT_VERIFY_CERT).content) - # Convert old API versioning to new versioning (major, minor, release) - version = (1, version % 100, 0) - except Exception: - version = (1, 0, 0) - return version + self.api = None def _get_auth(self): - """Select between api v2 and legacy.""" - return self._get_auth_v2() or self._get_auth_legacy() + """Authenticate with the client using the most recent API version available for use.""" + try: + auth = self._get_auth_v2() + version = 2 + except APIUnavailableError: + auth = self._get_auth_legacy() + version = 1 + + # Authentication failed /or/ We already have the API version + if not auth or self.api: + return auth + + # Get API version + if version == 2: + self.url = urljoin(self.host, 'api/v2/app/webapiVersion') + try: + response = self.session.get(self.url, verify=app.TORRENT_VERIFY_CERT) + if not response.text: + raise ValueError('Response from client is empty. [Status: {0}]'.format(response.status_code)) + # Make sure version is using the (major, minor, release) format + version = tuple(map(int, response.text.split('.'))) + # Fill up with zeros to get the correct format. e.g: (2, 3) => (2, 3, 0) + self.api = version + (0,) * (3 - len(version)) + except (AttributeError, ValueError) as error: + log.error('{name}: Unable to get API version. Error: {error!r}', + {'name': self.name, 'error': error}) + elif version == 1: + try: + self.url = urljoin(self.host, 'version/api') + version = int(self.session.get(self.url, verify=app.TORRENT_VERIFY_CERT).text) + # Convert old API versioning to new versioning (major, minor, release) + self.api = (1, version % 100, 0) + except Exception: + self.api = (1, 0, 0) + + return auth def _get_auth_v2(self): - """Authenticate using the new method (API v2).""" - self.url = '{host}api/v2/auth/login'.format(host=self.host) + """Authenticate using API v2.""" + self.url = urljoin(self.host, 'api/v2/auth/login') data = { 'username': self.username, 'password': self.password, @@ -79,17 +91,31 @@ def _get_auth_v2(self): except Exception: return None - if self.response.status_code == 404: - return None + if self.response.status_code == 200: + if self.response.text == 'Fails.': + log.warning('{name}: Invalid Username or Password, check your config', + {'name': self.name}) + return None - self.session.cookies = self.response.cookies - self.auth = self.response.content + # Successful log in + self.session.cookies = self.response.cookies + self.auth = self.response.text - return self.auth + return self.auth + + if self.response.status_code == 404: + # API v2 is not available + raise APIUnavailableError() + + if self.response.status_code == 403: + log.warning('{name}: Your IP address has been banned after too many failed authentication attempts.' + ' Restart {name} to unban.', + {'name': self.name}) + return None def _get_auth_legacy(self): - """Authenticate using the legacy method (API v1).""" - self.url = '{host}login'.format(host=self.host) + """Authenticate using legacy API.""" + self.url = urljoin(self.host, 'login') data = { 'username': self.username, 'password': self.password, @@ -99,7 +125,7 @@ def _get_auth_legacy(self): except Exception: return None - # Pre-API v1 + # API v1.0.0 (qBittorrent v3.1.x and older) if self.response.status_code == 404: try: self.response = self.session.get(self.host, verify=app.TORRENT_VERIFY_CERT) @@ -107,14 +133,14 @@ def _get_auth_legacy(self): return None self.session.cookies = self.response.cookies - self.auth = self.response.content + self.auth = (self.response.status_code != 404) or None - return self.auth if not self.response.status_code == 404 else None + return self.auth def _add_torrent_uri(self, result): command = 'api/v2/torrents/add' if self.api >= (2, 0, 0) else 'command/download' - self.url = '{host}{command}'.format(host=self.host, command=command) + self.url = urljoin(self.host, command) data = { 'urls': result.url, } @@ -123,7 +149,7 @@ def _add_torrent_uri(self, result): def _add_torrent_file(self, result): command = 'api/v2/torrents/add' if self.api >= (2, 0, 0) else 'command/upload' - self.url = '{host}{command}'.format(host=self.host, command=command) + self.url = urljoin(self.host, command) files = { 'torrents': ( '{result}.torrent'.format(result=result.name), @@ -140,27 +166,30 @@ def _set_torrent_label(self, result): api = self.api if api >= (2, 0, 0): - self.url = '{host}api/v2/torrents/setCategory'.format(host=self.host) + self.url = urljoin(self.host, 'api/v2/torrents/setCategory') label_key = 'category' elif api > (1, 6, 0): label_key = 'Category' if api >= (1, 10, 0) else 'Label' - self.url = '{host}command/set{key}'.format( - host=self.host, - key=label_key, - ) + self.url = urljoin(self.host, 'command/set' + label_key) data = { 'hashes': result.hash.lower(), label_key.lower(): label.replace(' ', '_'), } - return self._request(method='post', data=data, cookies=self.session.cookies) + ok = self._request(method='post', data=data, cookies=self.session.cookies) + + if self.response.status_code == 409: + log.warning('{name}: Unable to set torrent label. You need to create the label ' + ' in {name} first.', {'name': self.name}) + ok = False + + return ok def _set_torrent_priority(self, result): command = 'api/v2/torrents' if self.api >= (2, 0, 0) else 'command' method = 'increase' if result.priority == 1 else 'decrease' - self.url = '{host}{command}/{method}Prio'.format( - host=self.host, command=command, method=method) + self.url = urljoin(self.host, '{command}/{method}Prio'.format(command=command, method=method)) data = { 'hashes': result.hash.lower(), } @@ -178,7 +207,7 @@ def _set_torrent_pause(self, result): state = 'pause' if app.TORRENT_PAUSED else 'resume' command = 'api/v2/torrents' if api >= (2, 0, 0) else 'command' hashes_key = 'hashes' if self.api >= (1, 18, 0) else 'hash' - self.url = '{host}{command}/{state}'.format(host=self.host, command=command, state=state) + self.url = urljoin(self.host, '{command}/{state}'.format(command=command, state=state)) data = { hashes_key: result.hash.lower(), } @@ -196,10 +225,10 @@ def remove_torrent(self, info_hash): 'hashes': info_hash.lower(), } if self.api >= (2, 0, 0): - self.url = '{host}api/v2/torrents/delete'.format(host=self.host) + self.url = urljoin(self.host, 'api/v2/torrents/delete') data['deleteFiles'] = True else: - self.url = '{host}command/deletePerm'.format(host=self.host) + self.url = urljoin(self.host, 'command/deletePerm') return self._request(method='post', data=data, cookies=self.session.cookies) diff --git a/medusa/common.py b/medusa/common.py index 3daa818873..92e977e155 100644 --- a/medusa/common.py +++ b/medusa/common.py @@ -39,7 +39,7 @@ log.logger.addHandler(logging.NullHandler()) INSTANCE_ID = text_type(uuid.uuid1()) -VERSION = '0.3.8' +VERSION = '0.3.9' USER_AGENT = 'Medusa/{version} ({system}; {release}; {instance})'.format( version=VERSION, system=platform.system(), release=platform.release(), instance=INSTANCE_ID) diff --git a/medusa/providers/generic_provider.py b/medusa/providers/generic_provider.py index a37435d720..00e1bd184e 100644 --- a/medusa/providers/generic_provider.py +++ b/medusa/providers/generic_provider.py @@ -424,23 +424,20 @@ def find_search_results(self, series, episodes, search_mode, forced_search=False search_result.update_search_result() - if not search_result.actual_episodes: - episode_number = SEASON_RESULT + if search_result.episode_number == SEASON_RESULT: log.debug('Found season pack result {0} at {1}', search_result.name, search_result.url) - elif len(search_result.actual_episodes) == 1: - episode_number = search_result.actual_episode - log.debug('Found single episode result {0} at {1}', search_result.name, search_result.url) - else: - episode_number = MULTI_EP_RESULT + elif search_result.episode_number == MULTI_EP_RESULT: log.debug('Found multi-episode ({0}) result {1} at {2}', ', '.join(map(str, search_result.parsed_result.episode_numbers)), search_result.name, search_result.url) + else: + log.debug('Found single episode result {0} at {1}', search_result.name, search_result.url) - if episode_number not in final_results: - final_results[episode_number] = [search_result] + if search_result.episode_number not in final_results: + final_results[search_result.episode_number] = [search_result] else: - final_results[episode_number].append(search_result) + final_results[search_result.episode_number].append(search_result) if cl: # Access to a protected member of a client class diff --git a/medusa/tv/cache.py b/medusa/tv/cache.py index d59b923a1a..67eb545e06 100644 --- a/medusa/tv/cache.py +++ b/medusa/tv/cache.py @@ -609,11 +609,10 @@ def find_episodes(self, episodes): continue search_result = self.provider.get_result(series=series_obj, cache=cur_result) - if search_result.episode_number is not None: - if search_result in cache_results[search_result.episode_number]: - continue - # add it to the list - cache_results[search_result.episode_number].append(search_result) + if search_result in cache_results[search_result.episode_number]: + continue + # add it to the list + cache_results[search_result.episode_number].append(search_result) # datetime stamp this search so cache gets cleared self.searched = time() diff --git a/setup.cfg b/setup.cfg index 61cc30c0c1..640f17a42f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,7 @@ filterwarnings = ignore::PendingDeprecationWarning flake8-ignore = D107 + D401 W503 W504 medusa/__init__.py D104 F401 diff --git a/themes-default/slim/src/components/config-general.vue b/themes-default/slim/src/components/config-general.vue index 4439d11eff..ebc82fefb4 100644 --- a/themes-default/slim/src/components/config-general.vue +++ b/themes-default/slim/src/components/config-general.vue @@ -71,7 +71,9 @@
- + for adding shows and metadata providers @@ -590,10 +592,15 @@ export default { ...mapGetters([ 'getStatus' ]), - indexerDefault() { - const { config } = this; - const { indexerDefault } = config; - return indexerDefault || 0; + indexerDefault: { + get() { + const { config } = this; + const { indexerDefault } = config; + return indexerDefault || 0; + }, + set(indexer) { + this.config.indexerDefault = indexer; + } }, indexerListOptions() { const { indexers } = this; diff --git a/themes-default/slim/src/components/home.vue b/themes-default/slim/src/components/home.vue index ccbb4c2a5c..2c0f47738f 100644 --- a/themes-default/slim/src/components/home.vue +++ b/themes-default/slim/src/components/home.vue @@ -109,6 +109,12 @@ export default { }); } }, + beforeMount() { + // Wait for the next tick, so the component is rendered + this.$nextTick(() => { + $('#showTabs').tabs(); + }); + }, mounted() { const { config, stateLayout, setConfig } = this; // Resets the tables sorting, needed as we only use a single call for both tables in tablesorter diff --git a/themes/dark/assets/js/medusa-runtime.js b/themes/dark/assets/js/medusa-runtime.js index ae9a80597b..8faeaccfe3 100644 --- a/themes/dark/assets/js/medusa-runtime.js +++ b/themes/dark/assets/js/medusa-runtime.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,function(e,t,n){"use strict";var s=n(4),a=n.n(s),o=n(1),i=n(25);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var l={name:"app-link",props:{to:[String,Object],href:String,indexerId:{type:String},placeholder:{type:String,default:"indexer-to-name"}},computed:function(e){for(var t=1;tdocument.querySelector("base").getAttribute("href"),computedHref(){const{href:e,indexerId:t,placeholder:n,indexerName:s}=this;return t&&n?e.replace(n,s):e},isIRC(){if(this.computedHref)return this.computedHref.startsWith("irc://")},isAbsolute(){const e=this.computedHref;if(e)return/^[a-z][a-z0-9+.-]*:/.test(e)},isExternal(){const e=this.computedBase,t=this.computedHref;if(t)return!t.startsWith(e)&&!t.startsWith("webcal://")},isHashPath(){if(this.computedHref)return this.computedHref.startsWith("#")},anonymisedHref(){const{anonRedirect:e}=this.config,t=this.computedHref;if(t)return e?e+t:t},matchingVueRoute(){const{isAbsolute:e,isExternal:t,computedHref:n}=this;if(e&&t)return;const{route:s}=i.b.resolve(i.a+n);return s.name?s:void 0},linkProperties(){const{to:e,isIRC:t,isAbsolute:n,isExternal:s,isHashPath:a,anonymisedHref:o,matchingVueRoute:i}=this,r=this.computedBase,l=this.computedHref;return e?{is:"router-link",to:e}:l?i&&this.$route&&i.meta.converted&&this.$route.meta.converted&&window.loadMainApp?{is:"router-link",to:i.fullPath}:{is:"a",target:n&&s?"_blank":"_self",href:(()=>{if(a){const{location:e}=window;if(0===e.hash.length){const t=e.href.endsWith("#")?l.substr(1):l;return e.href+t}return e.href.replace(e.hash,"")+l}return t?l:n?s?o:l:new URL(l,r).href})(),rel:n&&s?"noreferrer":void 0}:{is:"a",falseLink:Boolean(this.$attrs.name)||void 0}}})},c=(n(190),n(0)),d=Object(c.a)(l,function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.linkProperties.is,{tag:"component",class:{"router-link":"router-link"===e.linkProperties.is},attrs:{to:e.linkProperties.to,href:e.linkProperties.href,target:e.linkProperties.target,rel:e.linkProperties.rel,"false-link":e.linkProperties.falseLink}},[e._t("default")],2)},[],!1,null,null,null).exports,u=n(3),p={name:"asset",components:{AppLink:d},props:{showSlug:{type:String},type:{type:String,required:!0},default:{type:String,required:!0},link:{type:Boolean,default:!1},cls:{type:String}},data:()=>({error:!1}),computed:{src(){const{error:e,showSlug:t,type:n}=this;return!e&&t&&n?u.e+"/api/v2/series/"+t+"/asset/"+n+"?api_key="+u.b:this.default},href(){if(this.link)return this.src.replace("Thumb","")}}},h=Object(c.a)(p,function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.link?n("app-link",{attrs:{href:e.href}},[n("img",{class:e.cls,attrs:{src:e.src},on:{error:function(t){e.error=!0}}})]):n("img",{class:e.cls,attrs:{src:e.src},on:{error:function(t){e.error=!0}}})},[],!1,null,null,null).exports,f={name:"config-template",props:{label:{type:String,required:!0},labelFor:{type:String,required:!0}}},m=Object(c.a)(f,function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"config-template-content"}},[t("div",{staticClass:"form-group"},[t("div",{staticClass:"row"},[t("label",{staticClass:"col-sm-2 control-label",attrs:{for:this.labelFor}},[t("span",[this._v(this._s(this.label))])]),this._v(" "),t("div",{staticClass:"col-sm-10 content"},[this._t("default")],2)])])])},[],!1,null,null,null).exports,g={name:"config-textbox-number",props:{label:{type:String,required:!0},id:{type:String,required:!0},explanations:{type:Array,default:()=>[]},value:{type:Number,default:10},inputClass:{type:String,default:"form-control input-sm input75"},min:{type:Number,default:10},max:{type:Number,default:null},step:{type:Number,default:1},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},data:()=>({localValue:null}),mounted(){const{value:e}=this;this.localValue=e},watch:{value(){const{value:e}=this;this.localValue=e}},methods:{updateValue(){const{localValue:e}=this;this.$emit("input",Number(e))}}},v=(n(192),Object(c.a)(g,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"config-textbox-number-content"}},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[n("label",{staticClass:"col-sm-2 control-label",attrs:{for:e.id}},[n("span",[e._v(e._s(e.label))])]),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.localValue,expression:"localValue"}],attrs:{type:"number"},domProps:{value:e.localValue},on:{input:[function(t){t.target.composing||(e.localValue=t.target.value)},function(t){return e.updateValue()}]}},"input",{min:e.min,max:e.max,step:e.step,id:e.id,name:e.id,class:e.inputClass,placeholder:e.placeholder,disabled:e.disabled},!1)),e._v(" "),e._l(e.explanations,function(t,s){return n("p",{key:s},[e._v(e._s(t))])}),e._v(" "),e._t("default")],2)])])])},[],!1,null,null,null).exports),b={name:"config-textbox",props:{label:{type:String,required:!0},id:{type:String,required:!0},explanations:{type:Array,default:()=>[]},value:{type:String,default:""},type:{type:String,default:"text"},disabled:{type:Boolean,default:!1},inputClass:{type:String,default:"form-control input-sm max-input350"},placeholder:{type:String,default:""}},data:()=>({localValue:null}),mounted(){const{value:e}=this;this.localValue=e},watch:{value(){const{value:e}=this;this.localValue=e}},methods:{updateValue(){const{localValue:e}=this;this.$emit("input",e)}}},_=(n(194),Object(c.a)(b,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"config-textbox"}},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[n("label",{staticClass:"col-sm-2 control-label",attrs:{for:e.id}},[n("span",[e._v(e._s(e.label))])]),e._v(" "),n("div",{staticClass:"col-sm-10 content"},["checkbox"===[e.id,e.type,e.id,e.inputClass,e.placeholder,e.disabled][1]?n("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.localValue,expression:"localValue"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.localValue)?e._i(e.localValue,null)>-1:e.localValue},on:{input:function(t){return e.updateValue()},change:function(t){var n=e.localValue,s=t.target,a=!!s.checked;if(Array.isArray(n)){var o=e._i(n,null);s.checked?o<0&&(e.localValue=n.concat([null])):o>-1&&(e.localValue=n.slice(0,o).concat(n.slice(o+1)))}else e.localValue=a}}},"input",{id:e.id,type:e.type,name:e.id,class:e.inputClass,placeholder:e.placeholder,disabled:e.disabled},!1)):"radio"===[e.id,e.type,e.id,e.inputClass,e.placeholder,e.disabled][1]?n("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.localValue,expression:"localValue"}],attrs:{type:"radio"},domProps:{checked:e._q(e.localValue,null)},on:{input:function(t){return e.updateValue()},change:function(t){e.localValue=null}}},"input",{id:e.id,type:e.type,name:e.id,class:e.inputClass,placeholder:e.placeholder,disabled:e.disabled},!1)):n("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.localValue,expression:"localValue"}],attrs:{type:[e.id,e.type,e.id,e.inputClass,e.placeholder,e.disabled][1]},domProps:{value:e.localValue},on:{input:[function(t){t.target.composing||(e.localValue=t.target.value)},function(t){return e.updateValue()}]}},"input",{id:e.id,type:e.type,name:e.id,class:e.inputClass,placeholder:e.placeholder,disabled:e.disabled},!1)),e._v(" "),e._l(e.explanations,function(t,s){return n("p",{key:s},[e._v(e._s(t))])}),e._v(" "),e._t("default")],2)])])])},[],!1,null,null,null).exports),w={name:"config-toggle-slider",components:{ToggleButton:n(17).ToggleButton},props:{label:{type:String,required:!0},id:{type:String,required:!0},value:{type:Boolean,default:null},disabled:{type:Boolean,default:!1},explanations:{type:Array,default:()=>[]}},data:()=>({localChecked:null}),mounted(){const{value:e}=this;this.localChecked=e},watch:{value(){const{value:e}=this;this.localChecked=e}},methods:{updateValue(){const{localChecked:e}=this;this.$emit("input",e)}}},y=(n(196),Object(c.a)(w,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"config-toggle-slider-content"}},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[n("label",{staticClass:"col-sm-2 control-label",attrs:{for:e.id}},[n("span",[e._v(e._s(e.label))])]),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("toggle-button",e._b({attrs:{width:45,height:22,sync:""},on:{input:function(t){return e.updateValue()}},model:{value:e.localChecked,callback:function(t){e.localChecked=t},expression:"localChecked"}},"toggle-button",{id:e.id,name:e.id,disabled:e.disabled},!1)),e._v(" "),e._l(e.explanations,function(t,s){return n("p",{key:s},[e._v(e._s(t))])}),e._v(" "),e._t("default")],2)])])])},[],!1,null,null,null).exports),x=n(38).a,k=(n(198),Object(c.a)(x,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"file-browser max-width"},[n("div",{class:e.showBrowseButton?"input-group":"input-group-no-btn"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.currentPath,expression:"currentPath"}],ref:"locationInput",staticClass:"form-control input-sm fileBrowserField",attrs:{name:e.name,type:"text"},domProps:{value:e.currentPath},on:{input:function(t){t.target.composing||(e.currentPath=t.target.value)}}}),e._v(" "),e.showBrowseButton?n("div",{staticClass:"input-group-btn",attrs:{title:e.title,alt:e.title},on:{click:function(t){return t.preventDefault(),e.openDialog(t)}}},[e._m(0)]):e._e()]),e._v(" "),n("div",{ref:"fileBrowserDialog",staticClass:"fileBrowserDialog",staticStyle:{display:"none"}}),e._v(" "),n("input",{ref:"fileBrowserSearchBox",staticClass:"form-control",staticStyle:{display:"none"},attrs:{type:"text"},domProps:{value:e.currentPath},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.browse(t.target.value)}}}),e._v(" "),n("ul",{ref:"fileBrowserFileList",staticStyle:{display:"none"}},e._l(e.files,function(t){return n("li",{key:t.name,staticClass:"ui-state-default ui-corner-all"},[n("a",{on:{mouseover:function(n){return e.toggleFolder(t,n)},mouseout:function(n){return e.toggleFolder(t,n)},click:function(n){return e.fileClicked(t)}}},[n("span",{class:"ui-icon "+(t.isFile?"ui-icon-blank":"ui-icon-folder-collapsed")}),e._v(" "+e._s(t.name)+"\n ")])])}),0)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"btn btn-default input-sm",staticStyle:{"font-size":"14px"}},[t("i",{staticClass:"glyphicon glyphicon-open"})])}],!1,null,"eff76864",null).exports),S=n(40).a,C=Object(c.a)(S,function(){var e=this.$createElement;return(this._self._c||e)("select")},[],!1,null,null,null).exports,O=n(41).a,P=Object(c.a)(O,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"name-pattern-wrapper"}},[e.type?n("div",{staticClass:"form-group"},[n("label",{staticClass:"col-sm-2 control-label",attrs:{for:"enable_naming_custom"}},[n("span",[e._v("Custom "+e._s(e.type))])]),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("toggle-button",{attrs:{width:45,height:22,id:"enable_naming_custom",name:"enable_naming_custom",sync:""},on:{input:function(t){return e.update()}},model:{value:e.isEnabled,callback:function(t){e.isEnabled=t},expression:"isEnabled"}}),e._v(" "),n("span",[e._v("Name "+e._s(e.type)+" shows differently than regular shows?")])],1)]):e._e(),e._v(" "),!e.type||e.isEnabled?n("div",{staticClass:"episode-naming"},[n("div",{staticClass:"form-group"},[e._m(0),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedNamingPattern,expression:"selectedNamingPattern"}],staticClass:"form-control input-sm",attrs:{id:"name_presets"},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedNamingPattern=t.target.multiple?n:n[0]},e.updatePatternSamples],input:function(t){return e.update()}}},e._l(e.presets,function(t){return n("option",{key:t.pattern,attrs:{id:t.pattern}},[e._v(e._s(t.example))])}),0)])]),e._v(" "),n("div",{attrs:{id:"naming_custom"}},[e.isCustom?n("div",{staticClass:"form-group",staticStyle:{"padding-top":"0"}},[e._m(1),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.customName,expression:"customName"}],staticClass:"form-control-inline-max input-sm max-input350",attrs:{type:"text",name:"naming_pattern",id:"naming_pattern"},domProps:{value:e.customName},on:{change:e.updatePatternSamples,input:[function(t){t.target.composing||(e.customName=t.target.value)},function(t){return e.update()}]}}),e._v(" "),n("img",{staticClass:"legend",attrs:{src:"images/legend16.png",width:"16",height:"16",alt:"[Toggle Key]",id:"show_naming_key",title:"Toggle Naming Legend"},on:{click:function(t){e.showLegend=!e.showLegend}}})])]):e._e(),e._v(" "),e.showLegend&&e.isCustom?n("div",{staticClass:"nocheck",attrs:{id:"naming_key"}},[n("table",{staticClass:"Key"},[e._m(2),e._v(" "),e._m(3),e._v(" "),n("tbody",[e._m(4),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),n("tr",[e._m(20),e._v(" "),n("td",[e._v("%M")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("M")))])]),e._v(" "),n("tr",{staticClass:"even"},[n("td",[e._v(" ")]),e._v(" "),n("td",[e._v("%D")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("d")))])]),e._v(" "),n("tr",[n("td",[e._v(" ")]),e._v(" "),n("td",[e._v("%Y")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("yyyy")))])]),e._v(" "),n("tr",[e._m(21),e._v(" "),n("td",[e._v("%CM")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("M")))])]),e._v(" "),n("tr",{staticClass:"even"},[n("td",[e._v(" ")]),e._v(" "),n("td",[e._v("%CD")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("d")))])]),e._v(" "),n("tr",[n("td",[e._v(" ")]),e._v(" "),n("td",[e._v("%CY")]),e._v(" "),n("td",[e._v(e._s(e.getDateFormat("yyyy")))])]),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),e._m(29),e._v(" "),e._m(30)])])]):e._e()]),e._v(" "),e.selectedMultiEpStyle?n("div",{staticClass:"form-group"},[e._m(31),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedMultiEpStyle,expression:"selectedMultiEpStyle"}],staticClass:"form-control input-sm",attrs:{id:"naming_multi_ep",name:"naming_multi_ep"},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedMultiEpStyle=t.target.multiple?n:n[0]},e.updatePatternSamples],input:function(t){return e.update(t)}}},e._l(e.availableMultiEpStyles,function(t){return n("option",{key:t.value,attrs:{id:"multiEpStyle"},domProps:{value:t.value}},[e._v(e._s(t.text))])}),0)])]):e._e(),e._v(" "),n("div",{staticClass:"form-group row"},[n("h3",{staticClass:"col-sm-12"},[e._v("Single-EP Sample:")]),e._v(" "),n("div",{staticClass:"example col-sm-12"},[n("span",{staticClass:"jumbo",attrs:{id:"naming_example"}},[e._v(e._s(e.namingExample))])])]),e._v(" "),e.isMulti?n("div",{staticClass:"form-group row"},[n("h3",{staticClass:"col-sm-12"},[e._v("Multi-EP sample:")]),e._v(" "),n("div",{staticClass:"example col-sm-12"},[n("span",{staticClass:"jumbo",attrs:{id:"naming_example_multi"}},[e._v(e._s(e.namingExampleMulti))])])]):e._e(),e._v(" "),e.animeType>0?n("div",{staticClass:"form-group"},[e._m(32),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.animeType,expression:"animeType"}],attrs:{type:"radio",name:"naming_anime",id:"naming_anime",value:"1"},domProps:{checked:e._q(e.animeType,"1")},on:{change:[function(t){e.animeType="1"},e.updatePatternSamples],input:function(t){return e.update()}}}),e._v(" "),n("span",[e._v("Add the absolute number to the season/episode format?")]),e._v(" "),n("p",[e._v("Only applies to animes. (e.g. S15E45 - 310 vs S15E45)")])])]):e._e(),e._v(" "),e.animeType>0?n("div",{staticClass:"form-group"},[e._m(33),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.animeType,expression:"animeType"}],attrs:{type:"radio",name:"naming_anime",id:"naming_anime_only",value:"2"},domProps:{checked:e._q(e.animeType,"2")},on:{change:[function(t){e.animeType="2"},e.updatePatternSamples],input:function(t){return e.update()}}}),e._v(" "),n("span",[e._v("Replace season/episode format with absolute number")]),e._v(" "),n("p",[e._v("Only applies to animes.")])])]):e._e(),e._v(" "),e.animeType>0?n("div",{staticClass:"form-group"},[e._m(34),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.animeType,expression:"animeType"}],attrs:{type:"radio",name:"naming_anime",id:"naming_anime_none",value:"3"},domProps:{checked:e._q(e.animeType,"3")},on:{change:[function(t){e.animeType="3"},e.updatePatternSamples],input:function(t){return e.update()}}}),e._v(" "),n("span",[e._v("Don't include the absolute number")]),e._v(" "),n("p",[e._v("Only applies to animes.")])])]):e._e()]):e._e()])},[function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"name_presets"}},[t("span",[this._v("Name Pattern:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label"},[t("span",[this._v(" ")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("thead",[t("tr",[t("th",{staticClass:"align-right"},[this._v("Meaning")]),this._v(" "),t("th",[this._v("Pattern")]),this._v(" "),t("th",{attrs:{width:"60%"}},[this._v("Result")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tfoot",[t("tr",[t("th",{attrs:{colspan:"3"}},[this._v("Use lower case if you want lower case names (eg. %sn, %e.n, %q_n etc)")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",{staticClass:"align-right"},[t("b",[this._v("Show Name:")])]),this._v(" "),t("td",[this._v("%SN")]),this._v(" "),t("td",[this._v("Show Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%S.N")]),this._v(" "),t("td",[this._v("Show.Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%S_N")]),this._v(" "),t("td",[this._v("Show_Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("Season Number:")])]),this._v(" "),t("td",[this._v("%S")]),this._v(" "),t("td",[this._v("2")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%0S")]),this._v(" "),t("td",[this._v("02")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("XEM Season Number:")])]),this._v(" "),t("td",[this._v("%XS")]),this._v(" "),t("td",[this._v("2")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%0XS")]),this._v(" "),t("td",[this._v("02")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("Episode Number:")])]),this._v(" "),t("td",[this._v("%E")]),this._v(" "),t("td",[this._v("3")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%0E")]),this._v(" "),t("td",[this._v("03")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("XEM Episode Number:")])]),this._v(" "),t("td",[this._v("%XE")]),this._v(" "),t("td",[this._v("3")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%0XE")]),this._v(" "),t("td",[this._v("03")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("Absolute Episode Number:")])]),this._v(" "),t("td",[this._v("%AB")]),this._v(" "),t("td",[this._v("003")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",{staticClass:"align-right"},[t("b",[this._v("Xem Absolute Episode Number:")])]),this._v(" "),t("td",[this._v("%XAB")]),this._v(" "),t("td",[this._v("003")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("b",[this._v("Episode Name:")])]),this._v(" "),t("td",[this._v("%EN")]),this._v(" "),t("td",[this._v("Episode Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%E.N")]),this._v(" "),t("td",[this._v("Episode.Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%E_N")]),this._v(" "),t("td",[this._v("Episode_Name")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("td",{staticClass:"align-right"},[t("b",[this._v("Air Date:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("td",{staticClass:"align-right"},[t("b",[this._v("Post-Processing Date:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",{staticClass:"align-right"},[t("b",[this._v("Quality:")])]),this._v(" "),t("td",[this._v("%QN")]),this._v(" "),t("td",[this._v("720p BluRay")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%Q.N")]),this._v(" "),t("td",[this._v("720p.BluRay")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%Q_N")]),this._v(" "),t("td",[this._v("720p_BluRay")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",{staticClass:"align-right"},[t("b",[this._v("Scene Quality:")])]),this._v(" "),t("td",[this._v("%SQN")]),this._v(" "),t("td",[this._v("720p HDTV x264")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%SQ.N")]),this._v(" "),t("td",[this._v("720p.HDTV.x264")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",[this._v(" ")]),this._v(" "),t("td",[this._v("%SQ_N")]),this._v(" "),t("td",[this._v("720p_HDTV_x264")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("i",{staticClass:"glyphicon glyphicon-info-sign",attrs:{title:"Multi-EP style is ignored"}}),this._v(" "),t("b",[this._v("Release Name:")])]),this._v(" "),t("td",[this._v("%RN")]),this._v(" "),t("td",[this._v("Show.Name.S02E03.HDTV.x264-RLSGROUP")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",[t("td",{staticClass:"align-right"},[t("i",{staticClass:"glyphicon glyphicon-info-sign",attrs:{title:"UNKNOWN_RELEASE_GROUP is used in place of RLSGROUP if it could not be properly detected"}}),this._v(" "),t("b",[this._v("Release Group:")])]),this._v(" "),t("td",[this._v("%RG")]),this._v(" "),t("td",[this._v("RLSGROUP")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("tr",{staticClass:"even"},[t("td",{staticClass:"align-right"},[t("i",{staticClass:"glyphicon glyphicon-info-sign",attrs:{title:"If episode is proper/repack add 'proper' to name."}}),this._v(" "),t("b",[this._v("Release Type:")])]),this._v(" "),t("td",[this._v("%RT")]),this._v(" "),t("td",[this._v("PROPER")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"naming_multi_ep"}},[t("span",[this._v("Multi-Episode Style:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"naming_anime"}},[t("span",[this._v("Add Absolute Number")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"naming_anime_only"}},[t("span",[this._v("Only Absolute Number")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"naming_anime_none"}},[t("span",[this._v("No Absolute Number")])])}],!1,null,null,null).exports,E={name:"plot-info",directives:{tooltip:n(23).b},props:{description:{type:String,required:!0}},computed:{plotInfoClass(){return""===this.description?"plotInfoNone":"plotInfo"}}},D=(n(200),Object(c.a)(E,function(){var e=this.$createElement,t=this._self._c||e;return""!==this.description?t("img",{directives:[{name:"tooltip",rawName:"v-tooltip.right",value:{content:this.description},expression:"{content: description}",modifiers:{right:!0}}],class:this.plotInfoClass,attrs:{src:"images/info32.png",width:"16",height:"16",alt:""}}):this._e()},[],!1,null,"0729869c",null).exports);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var N={name:"quality-chooser",components:{AppLink:d},props:{overallQuality:{type:Number,default:window.qualityChooserInitialQuality},keep:{type:String,default:null,validator:e=>["keep","show"].includes(e)},showSlug:{type:String}},data:()=>({lock:!1,allowedQualities:[],preferredQualities:[],curQualityPreset:null,archive:!1,archivedStatus:"",archiveButton:{text:"Archive episodes",disabled:!1}}),computed:function(e){for(var t=1;te.consts.qualities.values,qualityPresets:e=>e.consts.qualities.presets,defaultQuality:e=>e.config.showDefaults.quality}),{},Object(o.d)(["getQualityPreset","splitQuality"]),{initialQuality(){return void 0===this.overallQuality?this.defaultQuality:this.overallQuality},selectedQualityPreset:{get(){return this.curQualityPreset},set(e){const{curQualityPreset:t,setQualityFromPreset:n}=this,[s,a]=Array.isArray(e)?e:[e,t];n(s,a),this.curQualityPreset=s}},explanation(){const{allowedQualities:e,preferredQualities:t,qualityValues:n}=this;return n.reduce((n,{value:s,name:a})=>{const o=t.includes(s);return(e.includes(s)||o)&&n.allowed.push(a),o&&n.preferred.push(a),n},{allowed:[],preferred:[]})},validQualities(){return this.qualityValues.filter(({key:e})=>"na"!==e)}}),asyncComputed:{async backloggedEpisodes(){const{showSlug:e,allowedQualities:t,preferredQualities:n}=this;if(!e)return null;if(t.length+n.length===0)return null;const s="series/".concat(e,"/legacy/backlogged"),a={allowed:t.join(","),preferred:n.join(",")};let o,i=!1;try{o=await u.a.get(s,{params:a})}catch(e){return{status:i,html:"Failed to get backlog prediction
"+String(e)}}const r=o.data.new,l=o.data.existing,c=Math.abs(r-l);let d="Current backlog: "+l+" episodes
";if(-1===r||-1===l)d="No qualities selected";else if(r===l)d+="This change won't affect your backlogged episodes",i=!0;else{d+="
New backlog: "+r+" episodes",d+="

";let e="";r>l?(d+="WARNING: ",e="increase",this.archive=!0):e="decrease",d+="Backlog will "+e+" by "+c+" episodes."}return{status:i,html:d}}},mounted(){this.setInitialPreset(this.initialQuality)},methods:{isQualityPreset(e){return void 0!==this.getQualityPreset({value:e})},setInitialPreset(e){const{isQualityPreset:t,keep:n}=this,s="keep"===n?"keep":t(e)?e:0;this.selectedQualityPreset=[s,e]},async archiveEpisodes(){this.archivedStatus="Archiving...";const e="series/".concat(this.showSlug,"/operation"),t=await u.a.post(e,{type:"ARCHIVE_EPISODES"});201===t.status?(this.archivedStatus="Successfully archived episodes",this.$asyncComputed.backloggedEpisodes.update()):204===t.status&&(this.archivedStatus="No episodes to be archived"),this.archiveButton.text="Finished",this.archiveButton.disabled=!0},setQualityFromPreset(e,t){if(null==e)return;[e,t].some(e=>"keep"===e)?e=this.initialQuality:0!==e&&this.isQualityPreset(e)||null===t||(e=t);const{allowed:n,preferred:s}=this.splitQuality(e);this.allowedQualities=n,this.preferredQualities=s}},watch:{overallQuality(e){this.lock||this.setInitialPreset(e)},allowedQualities(e){0===e.length&&this.preferredQualities.length>0&&(this.preferredQualities=[]),this.lock=!0,this.$emit("update:quality:allowed",e),this.$nextTick(()=>{this.lock=!1})},preferredQualities(e){this.lock=!0,this.$emit("update:quality:preferred",e),this.$nextTick(()=>{this.lock=!1})}}},A=(n(202),Object(c.a)(N,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("select",{directives:[{name:"model",rawName:"v-model.number",value:e.selectedQualityPreset,expression:"selectedQualityPreset",modifiers:{number:!0}}],staticClass:"form-control form-control-inline input-sm",attrs:{name:"quality_preset"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(t){var n="_value"in t?t._value:t.value;return e._n(n)});e.selectedQualityPreset=t.target.multiple?n:n[0]}}},[e.keep?n("option",{attrs:{value:"keep"}},[e._v("< Keep >")]):e._e(),e._v(" "),n("option",{domProps:{value:0}},[e._v("Custom")]),e._v(" "),e._l(e.qualityPresets,function(t){return n("option",{key:"quality-preset-"+t.key,domProps:{value:t.value}},[e._v("\n "+e._s(t.name)+"\n ")])})],2),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:0===e.selectedQualityPreset,expression:"selectedQualityPreset === 0"}],attrs:{id:"customQualityWrapper"}},[e._m(0),e._v(" "),n("div",[n("h5",[e._v("Allowed")]),e._v(" "),n("select",{directives:[{name:"model",rawName:"v-model.number",value:e.allowedQualities,expression:"allowedQualities",modifiers:{number:!0}}],staticClass:"form-control form-control-inline input-sm",attrs:{name:"allowed_qualities",multiple:"multiple",size:e.validQualities.length},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(t){var n="_value"in t?t._value:t.value;return e._n(n)});e.allowedQualities=t.target.multiple?n:n[0]}}},e._l(e.validQualities,function(t){return n("option",{key:"quality-list-"+t.key,domProps:{value:t.value}},[e._v("\n "+e._s(t.name)+"\n ")])}),0)]),e._v(" "),n("div",[n("h5",[e._v("Preferred")]),e._v(" "),n("select",{directives:[{name:"model",rawName:"v-model.number",value:e.preferredQualities,expression:"preferredQualities",modifiers:{number:!0}}],staticClass:"form-control form-control-inline input-sm",attrs:{name:"preferred_qualities",multiple:"multiple",size:e.validQualities.length,disabled:0===e.allowedQualities.length},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(t){var n="_value"in t?t._value:t.value;return e._n(n)});e.preferredQualities=t.target.multiple?n:n[0]}}},e._l(e.validQualities,function(t){return n("option",{key:"quality-list-"+t.key,domProps:{value:t.value}},[e._v("\n "+e._s(t.name)+"\n ")])}),0)])]),e._v(" "),"keep"!==e.selectedQualityPreset?n("div",[e.allowedQualities.length+e.preferredQualities.length>=1?n("div",{attrs:{id:"qualityExplanation"}},[e._m(1),e._v(" "),0===e.preferredQualities.length?n("h5",[e._v("\n This will download "),n("b",[e._v("any")]),e._v(" of these qualities and then stops searching:\n "),n("label",{attrs:{id:"allowedExplanation"}},[e._v(e._s(e.explanation.allowed.join(", ")))])]):[n("h5",[e._v("\n Downloads "),n("b",[e._v("any")]),e._v(" of these qualities:\n "),n("label",{attrs:{id:"allowedPreferredExplanation"}},[e._v(e._s(e.explanation.allowed.join(", ")))])]),e._v(" "),n("h5",[e._v("\n But it will stop searching when one of these is downloaded:\n "),n("label",{attrs:{id:"preferredExplanation"}},[e._v(e._s(e.explanation.preferred.join(", ")))])])]],2):n("div",[e._v("Please select at least one allowed quality.")])]):e._e(),e._v(" "),e.backloggedEpisodes?n("div",[n("h5",{staticClass:"{ 'red-text': !backloggedEpisodes.status }",domProps:{innerHTML:e._s(e.backloggedEpisodes.html)}})]):e._e(),e._v(" "),e.archive?n("div",{attrs:{id:"archive"}},[n("h5",[n("b",[e._v("Archive downloaded episodes that are not currently in\n "),n("app-link",{staticClass:"backlog-link",attrs:{href:"manage/backlogOverview/",target:"_blank"}},[e._v("backlog")]),e._v(".")],1),e._v(" "),n("br"),e._v("Avoids unnecessarily increasing your backlog\n "),n("br")]),e._v(" "),n("button",{staticClass:"btn-medusa btn-inline",attrs:{disabled:e.archiveButton.disabled},on:{click:function(t){return t.preventDefault(),e.archiveEpisodes(t)}}},[e._v("\n "+e._s(e.archiveButton.text)+"\n ")]),e._v(" "),n("h5",[e._v(e._s(e.archivedStatus))])]):e._e()])},[function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("b",[t("strong",[this._v("Preferred")])]),this._v(" qualities will replace those in "),t("b",[t("strong",[this._v("allowed")])]),this._v(", even if they are lower.\n ")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h5",[t("b",[this._v("Quality setting explanation:")])])}],!1,null,"751f4e5c",null).exports),$=n(79),j=n(45).a,M=(n(206),Object(c.a)(j,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"scroll-buttons-wrapper"}},[n("div",{staticClass:"scroll-wrapper top",class:{show:e.showToTop},on:{click:function(t){return t.preventDefault(),e.scrollTop(t)}}},[e._m(0)]),e._v(" "),n("div",{staticClass:"scroll-wrapper left",class:{show:e.showLeftRight}},[n("span",{staticClass:"scroll-left-inner"},[n("i",{staticClass:"glyphicon glyphicon-circle-arrow-left",on:{click:function(t){return t.preventDefault(),e.scrollLeft(t)}}})])]),e._v(" "),n("div",{staticClass:"scroll-wrapper right",class:{show:e.showLeftRight}},[n("span",{staticClass:"scroll-right-inner"},[n("i",{staticClass:"glyphicon glyphicon-circle-arrow-right",on:{click:function(t){return t.preventDefault(),e.scrollRight(t)}}})])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"scroll-top-inner"},[t("i",{staticClass:"glyphicon glyphicon-circle-arrow-up"})])}],!1,null,null,null).exports),L={name:"select-list",props:{listItems:{type:Array,default:()=>[],required:!0},unique:{type:Boolean,default:!0,required:!1},csvEnabled:{type:Boolean,default:!1,required:!1},disabled:{type:Boolean,default:!1}},data(){return{editItems:[],newItem:"",indexCounter:0,csv:"",csvMode:this.csvEnabled}},mounted(){this.editItems=this.sanitize(this.listItems),this.csv=this.editItems.map(e=>e.value).join(", ")},created(){const e=this.$watch("listItems",()=>{e(),this.editItems=this.sanitize(this.listItems),this.csv=this.editItems.map(e=>e.value).join(", ")})},methods:{addItem(e){this.unique&&this.editItems.find(t=>t.value===e)||(this.editItems.push({id:this.indexCounter,value:e}),this.indexCounter+=1)},addNewItem(){const{newItem:e,editItems:t}=this;""!==this.newItem&&(this.addItem(e),this.newItem="",this.$emit("change",t))},deleteItem(e){this.editItems=this.editItems.filter(t=>t!==e),this.$refs.newItemInput.focus(),this.$emit("change",this.editItems)},removeEmpty(e){return""===e.value&&this.deleteItem(e)},sanitize(e){return e?e.map(e=>"string"==typeof e?(this.indexCounter+=1,{id:this.indexCounter-1,value:e}):e):[]},syncValues(){this.csvMode?(this.editItems=[],this.csv.split(",").forEach(e=>{e.trim()&&this.addItem(e.trim())}),this.$emit("change",this.editItems)):this.csv=this.editItems.map(e=>e.value).join(", ")},switchFields(){this.syncValues(),this.csvMode=!this.csvMode}},watch:{csv(){this.syncValues()},listItems(){this.editItems=this.sanitize(this.listItems),this.newItem=""}}},I=(n(208),Object(c.a)(L,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._b({staticClass:"select-list max-width"},"div",{disabled:e.disabled},!1),[n("i",{staticClass:"switch-input glyphicon glyphicon-refresh",attrs:{title:"Switch between a list and comma separated values"},on:{click:function(t){return e.switchFields()}}}),e._v(" "),e.csvMode?n("div",{staticClass:"csv"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.csv,expression:"csv"}],staticClass:"form-control input-sm",attrs:{type:"text",placeholder:"add values comma separated"},domProps:{value:e.csv},on:{input:function(t){t.target.composing||(e.csv=t.target.value)}}})]):n("ul",[e._l(e.editItems,function(t){return n("li",{key:t.id},[n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"item.value"}],staticClass:"form-control input-sm",attrs:{type:"text"},domProps:{value:t.value},on:{input:[function(n){n.target.composing||e.$set(t,"value",n.target.value)},function(n){return e.removeEmpty(t)}]}}),e._v(" "),n("div",{staticClass:"input-group-btn",on:{click:function(n){return e.deleteItem(t)}}},[e._m(0,!0)])])])}),e._v(" "),n("div",{staticClass:"new-item"},[n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newItem,expression:"newItem"}],ref:"newItemInput",staticClass:"form-control input-sm",attrs:{type:"text",placeholder:"add new values per line"},domProps:{value:e.newItem},on:{input:function(t){t.target.composing||(e.newItem=t.target.value)}}}),e._v(" "),n("div",{staticClass:"input-group-btn",on:{click:function(t){return e.addNewItem()}}},[e._m(1)])])]),e._v(" "),e.newItem.length>0?n("div",{staticClass:"new-item-help"},[e._v("\n Click "),n("i",{staticClass:"glyphicon glyphicon-plus"}),e._v(" to finish adding the value.\n ")]):e._e()],2)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"btn btn-default input-sm",staticStyle:{"font-size":"14px"}},[t("i",{staticClass:"glyphicon glyphicon-remove",attrs:{title:"Remove"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"btn btn-default input-sm",staticStyle:{"font-size":"14px"}},[t("i",{staticClass:"glyphicon glyphicon-plus",attrs:{title:"Add"}})])}],!1,null,"e3747674",null).exports);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var z={name:"show-selector",props:{showSlug:String,followSelection:{type:Boolean,default:!1},placeholder:String,selectClass:{type:String,default:"select-show form-control input-sm-custom"}},data(){return{selectedShowSlug:this.showSlug||this.placeholder,lock:!1}},computed:function(e){for(var t=1;te.layout,shows:e=>e.shows.shows}),{showLists(){const{layout:e,shows:t}=this,{animeSplitHome:n,sortArticle:s}=e,a=[{type:"Shows",shows:[]},{type:"Anime",shows:[]}];if(0===t.length)return;t.forEach(e=>{const t=Number(n&&e.config.anime);a[t].shows.push(e)});const o=e=>(s?e:e.replace(/^((?:The|A|An)\s)/i,"")).toLowerCase();return a.forEach(e=>{e.shows.sort((e,t)=>{const n=o(e.title),s=o(t.title);return ns?1:0})}),a},whichList(){const{showLists:e}=this,t=0!==e[0].shows.length,n=0!==e[1].shows.length;return t&&n?-1:n?1:0}}),watch:{showSlug(e){this.lock=!0,this.selectedShowSlug=e},selectedShowSlug(e){if(this.lock)return void(this.lock=!1);if(!this.followSelection)return;const{shows:t}=this,n=t.find(t=>t.id.slug===e);if(!n)return;const s=n.indexer,a=n.id[s],o=document.querySelector("base").getAttribute("href");window.location.href="".concat(o,"home/displayShow?indexername=").concat(s,"&seriesid=").concat(a)}}},R=(n(210),Object(c.a)(z,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"show-selector form-inline hidden-print"},[n("div",{staticClass:"select-show-group pull-left top-5 bottom-5"},[0===e.shows.length?n("select",{class:e.selectClass,attrs:{disabled:""}},[n("option",[e._v("Loading...")])]):n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedShowSlug,expression:"selectedShowSlug"}],class:e.selectClass,on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedShowSlug=t.target.multiple?n:n[0]},function(t){return e.$emit("change",e.selectedShowSlug)}]}},[e.placeholder?n("option",{attrs:{disabled:"",hidden:""},domProps:{value:e.placeholder,selected:!e.selectedShowSlug}},[e._v(e._s(e.placeholder))]):e._e(),e._v(" "),-1===e.whichList?e._l(e.showLists,function(t){return n("optgroup",{key:t.type,attrs:{label:t.type}},e._l(t.shows,function(t){return n("option",{key:t.id.slug,domProps:{value:t.id.slug}},[e._v(e._s(t.title))])}),0)}):e._l(e.showLists[e.whichList].shows,function(t){return n("option",{key:t.id.slug,domProps:{value:t.id.slug}},[e._v(e._s(t.title))])})],2)])])},[],!1,null,null,null).exports),F={name:"state-switch",props:{theme:{type:String,default:"dark",validator:e=>["dark","light"].includes(e)},state:{required:!0,validator:e=>["yes","no","loading","true","false","null"].includes(String(e))}},computed:{src(){const{theme:e,realState:t}=this;return"loading"===t?"images/loading16-".concat(e||"dark",".gif"):"images/".concat(t,"16.png")},alt(){const{realState:e}=this;return e.charAt(0).toUpperCase()+e.substr(1)},realState(){const{state:e}=this;return["null","true","false"].includes(String(e))?{null:"loading",true:"yes",false:"no"}[String(e)]:e}}},q=Object(c.a)(F,function(){var e=this,t=e.$createElement;return(e._self._c||t)("img",e._b({attrs:{height:"16",width:"16"},on:{click:function(t){return e.$emit("click")}}},"img",{src:e.src,alt:e.alt},!1))},[],!1,null,null,null).exports;n.d(t,"a",function(){return d}),n.d(t,"b",function(){return h}),n.d(t,"c",function(){return m}),n.d(t,"e",function(){return v}),n.d(t,"d",function(){return _}),n.d(t,"f",function(){return y}),n.d(t,"g",function(){return k}),n.d(t,"h",function(){return C}),n.d(t,"i",function(){return P}),n.d(t,"j",function(){return D}),n.d(t,"k",function(){return A}),n.d(t,"l",function(){return $.a}),n.d(t,"m",function(){return M}),n.d(t,"n",function(){return I}),n.d(t,"o",function(){return R}),n.d(t,"p",function(){return q})},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return r}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return c});var s=n(31),a=n.n(s);const o=document.body.getAttribute("web-root"),i=document.body.getAttribute("api-key"),r=a.a.create({baseURL:o+"/",timeout:6e4,headers:{Accept:"application/json","Content-Type":"application/json"}}),l=a.a.create({baseURL:o+"/api/v1/"+i+"/",timeout:3e4,headers:{Accept:"application/json","Content-Type":"application/json"}}),c=a.a.create({baseURL:o+"/api/v2/",timeout:3e4,headers:{Accept:"application/json","Content-Type":"application/json","X-Api-Key":i}})},,,function(e,t,n){"use strict";n.d(t,"f",function(){return s}),n.d(t,"c",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c}),n.d(t,"g",function(){return u});const s=!1,a=(e,t=[])=>{const n=(e,t)=>e|t;return(e.reduce(n,0)|t.reduce(n,0)<<16)>>>0},o=(e,t=!1)=>{e||(e=0),e=Math.max(e,0);const n=t?1e3:1024;if(Math.abs(e)=n&&a{let t="",n=0,s=!1;for(;ne.reduce((e,t)=>e.includes(t)?e:e.concat(t),[]),c=(e,t)=>e.filter(e=>!t.includes(e)),d=e=>new Promise(t=>setTimeout(t,e)),u=async(e,t=100,n=3e3)=>{let s=0;for(;!e();)if(await d(t),(s+=t)>n)throw new Error("waitFor timed out (".concat(n,"ms)"));return s}},,,,,,,,,,,,,,,function(e,t,n){"use strict";var s=n(52).a,a=n(0),o=Object(a.a)(s,void 0,void 0,!1,null,null,null);t.a=o.exports},function(e,t,n){"use strict";var s=n(9),a=n(1),o=n(124),i=n.n(o);const r="⚙️ Config added to store",l="📺 Show added to store",c="ℹ️ Statistics added to store";var d={state:{isAuthenticated:!1,user:{},tokens:{access:null,refresh:null},error:null},mutations:{"🔒 Logging in"(){},"🔒 ✅ Login Successful"(e,t){e.user=t,e.isAuthenticated=!0,e.error=null},"🔒 ❌ Login Failed"(e,{error:t}){e.user={},e.isAuthenticated=!1,e.error=t},"🔒 Logout"(e){e.user={},e.isAuthenticated=!1,e.error=null},"🔒 Refresh Token"(){},"🔒 Remove Auth Error"(){}},getters:{},actions:{login(e,t){const{commit:n}=e;n("🔒 Logging in");return(e=>Promise.resolve(e))(t).then(e=>(n("🔒 ✅ Login Successful",e),{success:!0})).catch(e=>(n("🔒 ❌ Login Failed",{error:e,credentials:t}),{success:!1,error:e}))},logout(e){const{commit:t}=e;t("🔒 Logout")}}};var u={state:{torrents:{authType:null,dir:null,enabled:null,highBandwidth:null,host:null,label:null,labelAnime:null,method:null,path:null,paused:null,rpcUrl:null,seedLocation:null,seedTime:null,username:null,password:null,verifySSL:null,testStatus:"Click below to test"},nzb:{enabled:null,method:null,nzbget:{category:null,categoryAnime:null,categoryAnimeBacklog:null,categoryBacklog:null,host:null,priority:null,useHttps:null,username:null,password:null},sabnzbd:{category:null,forced:null,categoryAnime:null,categoryBacklog:null,categoryAnimeBacklog:null,host:null,username:null,password:null,apiKey:null}}},mutations:{[r](e,{section:t,config:n}){"clients"===t&&(e=Object.assign(e,n))}},getters:{},actions:{}},p=n(3),h=n(6);var f={state:{wikiUrl:null,donationsUrl:null,selectedRootIndex:null,namingForceFolders:null,sourceUrl:null,downloadUrl:null,rootDirs:[],subtitles:{enabled:null},logs:{debug:null,dbDebug:null,loggingLevels:{},numErrors:null,numWarnings:null,actualLogDir:null,nr:null,size:null,subliminalLog:null,privacyLevel:null},cpuPreset:null,subtitlesMulti:null,anonRedirect:null,recentShows:[],randomShowSlug:null,showDefaults:{status:null,statusAfter:null,quality:null,subtitles:null,seasonFolders:null,anime:null,scene:null},launchBrowser:null,defaultPage:null,trashRemoveShow:null,indexerDefaultLanguage:null,showUpdateHour:null,indexerTimeout:null,indexerDefault:null,plexFallBack:{enable:null,notifications:null,timeout:null},versionNotify:null,autoUpdate:null,updateFrequency:null,notifyOnUpdate:null,availableThemes:null,timePresets:[],datePresets:[],webInterface:{apiKey:null,log:null,username:null,password:null,port:null,notifyOnLogin:null,ipv6:null,httpsEnable:null,httpsCert:null,httpsKey:null,handleReverseProxy:null},sslVerify:null,sslCaBundle:null,noRestart:null,encryptionVersion:null,calendarUnprotected:null,calendarIcons:null,proxySetting:null,proxyIndexers:null,skipRemovedFiles:null,epDefaultDeletedStatus:null,developer:null,git:{username:null,password:null,token:null,authType:null,remote:null,path:null,org:null,reset:null,resetBranches:null,url:null},backlogOverview:{status:null,period:null},themeName:null},mutations:{[r](e,{section:t,config:n}){"main"===t&&(e=Object.assign(e,n))}},getters:{layout:e=>t=>e.layout[t],effectiveIgnored:(e,t,n)=>e=>{const t=e.config.release.ignoredWords.map(e=>e.toLowerCase()),s=n.search.filters.ignored.map(e=>e.toLowerCase());return e.config.release.ignoredWordsExclude?Object(h.a)(s,t):Object(h.b)(s.concat(t))},effectiveRequired:(e,t,n)=>e=>{const t=n.search.filters.required.map(e=>e.toLowerCase()),s=e.config.release.requiredWords.map(e=>e.toLowerCase());return e.config.release.requiredWordsExclude?Object(h.a)(t,s):Object(h.b)(t.concat(s))}},actions:{getConfig(e,t){const{commit:n}=e;return p.a.get("/config/"+(t||"")).then(e=>{if(t){const s=e.data;return n(r,{section:t,config:s}),s}const s=e.data;return Object.keys(s).forEach(e=>{const t=s[e];n(r,{section:e,config:t})}),s})},setConfig:(e,{section:t,config:n})=>p.a.patch("config/".concat(t),n),updateConfig(e,{section:t,config:n}){const{commit:s}=e;return s(r,{section:t,config:n})},getApiKey(e){const{commit:t}=e,n={webInterface:{apiKey:""}};return p.c.get("config/general/generate_api_key").then(e=>(n.webInterface.apiKey=e.data,t(r,{section:"main",config:n})))}}};var m={state:{qualities:{values:[],anySets:[],presets:[]},statuses:[]},mutations:{[r](e,{section:t,config:n}){"consts"===t&&(e=Object.assign(e,n))}},getters:{getQuality:e=>({key:t,value:n})=>{if([t,n].every(e=>void 0===e)||[t,n].every(e=>void 0!==e))throw new Error("Conflict in `getQuality`: Please provide either `key` or `value`.");return e.qualities.values.find(e=>t===e.key||n===e.value)},getQualityAnySet:e=>({key:t,value:n})=>{if([t,n].every(e=>void 0===e)||[t,n].every(e=>void 0!==e))throw new Error("Conflict in `getQualityAnySet`: Please provide either `key` or `value`.");return e.qualities.anySets.find(e=>t===e.key||n===e.value)},getQualityPreset:e=>({key:t,value:n})=>{if([t,n].every(e=>void 0===e)||[t,n].every(e=>void 0!==e))throw new Error("Conflict in `getQualityPreset`: Please provide either `key` or `value`.");return e.qualities.presets.find(e=>t===e.key||n===e.value)},getStatus:e=>({key:t,value:n})=>{if([t,n].every(e=>void 0===e)||[t,n].every(e=>void 0!==e))throw new Error("Conflict in `getStatus`: Please provide either `key` or `value`.");return e.statuses.find(e=>t===e.key||n===e.value)},getOverviewStatus:e=>(e,t,n)=>{if(["Unset","Unaired"].includes(e))return"Unaired";if(["Skipped","Ignored"].includes(e))return"Skipped";if(["Wanted","Failed"].includes(e))return"Wanted";if(["Snatched","Snatched (Proper)","Snatched (Best)"].includes(e))return"Snatched";if(["Downloaded"].includes(e)){if(n.allowed.length>0&&0===n.preferred.length&&n.allowed.includes(t))return"Preferred";if(n.preferred.includes(t))return"Preferred";if(n.allowed.includes(t))return"Allowed"}return e},splitQuality:e=>{return t=>e.qualities.values.reduce((e,{value:n})=>(n&(t>>>=0)&&e.allowed.push(n),n<<16&t&&e.preferred.push(n),e),{allowed:[],preferred:[]})}},actions:{}};var g={state:{show:{airs:null,airsFormatValid:null,akas:null,cache:null,classification:null,seasonCount:[],config:{airByDate:null,aliases:[],anime:null,defaultEpisodeStatus:null,dvdOrder:null,location:null,locationValid:null,paused:null,qualities:{allowed:[],preferred:[]},release:{requiredWords:[],ignoredWords:[],blacklist:[],whitelist:[],requiredWordsExclude:null,ignoredWordsExclude:null},scene:null,seasonFolders:null,sports:null,subtitlesEnabled:null,airdateOffset:null},countries:null,genres:[],id:{tvdb:null,slug:null},indexer:null,imdbInfo:{akas:null,certificates:null,countries:null,countryCodes:null,genres:null,imdbId:null,imdbInfoId:null,indexer:null,indexerId:null,lastUpdate:null,plot:null,rating:null,runtimes:null,title:null,votes:null},language:null,network:null,nextAirDate:null,plot:null,rating:{imdb:{rating:null,votes:null}},runtime:null,showType:null,status:null,title:null,type:null,year:{},size:null,showQueueStatus:[],xemNumbering:[],sceneAbsoluteNumbering:[],allSceneExceptions:[],xemAbsoluteNumbering:[],sceneNumbering:[],episodeCount:null}},mutations:{},getters:{},actions:{}};var v={state:{main:{externalMappings:{},statusMap:{},traktIndexers:{},validLanguages:[],langabbvToId:{}},indexers:{tvdb:{apiParams:{useZip:null,language:null},baseUrl:null,enabled:null,icon:null,id:null,identifier:null,mappedTo:null,name:null,scene_loc:null,showUrl:null,xemOrigin:null},tmdb:{apiParams:{useZip:null,language:null},baseUrl:null,enabled:null,icon:null,id:null,identifier:null,mappedTo:null,name:null,scene_loc:null,showUrl:null,xemOrigin:null},tvmaze:{apiParams:{useZip:null,language:null},baseUrl:null,enabled:null,icon:null,id:null,identifier:null,mappedTo:null,name:null,scene_loc:null,showUrl:null,xemOrigin:null}}},mutations:{[r](e,{section:t,config:n}){"indexers"===t&&(e=Object.assign(e,n))}},getters:{indexerIdToName:e=>t=>{if(!t)return;const{indexers:n}=e;return Object.keys(n).find(e=>n[e].id===parseInt(t,10))},indexerNameToId:e=>t=>{if(!t)return;const{indexers:n}=e;return n[name].id}},actions:{}};var b={state:{show:{specials:null,showListOrder:[],pagination:{enable:null}},home:null,history:null,historyLimit:null,schedule:null,wide:null,posterSortdir:null,timezoneDisplay:null,timeStyle:null,dateStyle:null,themeName:null,animeSplitHomeInTabs:null,animeSplitHome:null,fanartBackground:null,fanartBackgroundOpacity:null,trimZero:null,sortArticle:null,fuzzyDating:null,posterSortby:null,comingEps:{missedRange:null,sort:null,displayPaused:null,layout:null},backlogOverview:{status:null,period:null}},mutations:{[r](e,{section:t,config:n}){"layout"===t&&(e=Object.assign(e,n))}},getters:{},actions:{setLayout:(e,{page:t,layout:n})=>p.a.patch("config/main",{layout:{[t]:n}}).then(()=>{setTimeout(()=>{location.reload()},500)}),setTheme(e,{themeName:t}){const{commit:n}=e;return p.a.patch("config/main",{layout:{themeName:t}}).then(()=>n(r,{section:"layout",config:{themeName:t}}))},setSpecials(e,t){const{commit:n,state:s}=e,a=Object.assign({},s.show);return a.specials=t,p.a.patch("config/main",{layout:{show:a}}).then(()=>n(r,{section:"layout",config:{show:a}}))}}};var _={state:{metadataProviders:{}},mutations:{[r](e,{section:t,config:n}){"metadata"===t&&(e=Object.assign(e,n))}},getters:{},actions:{}};var w={state:{enabled:!0},mutations:{"🔔 Notifications Enabled"(e){e.enabled=!0},"🔔 Notifications Disabled"(e){e.enabled=!1}},getters:{},actions:{enable(e){const{commit:t}=e;t("🔔 Notifications Enabled")},disable(e){const{commit:t}=e;t("🔔 Notifications Disabled")},test:()=>window.displayNotification("error","test",'test
hello world
  • item 1
  • item 2
',"notification-test")}};var y={state:{},mutations:{[r](e,{section:t,config:n}){"notifiers"===t&&(e=Object.assign(e,n))}},getters:{},actions:{},modules:{boxcar2:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,accessToken:null},mutations:{},getters:{},actions:{}},discord:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,webhook:null,tts:null},mutations:{},getters:{},actions:{}},email:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,host:null,port:null,from:null,tls:null,username:null,password:null,addressList:[],subject:null},mutations:{},getters:{},actions:{}},emby:{state:{enabled:null,host:null,apiKey:null},mutations:{},getters:{},actions:{}},freemobile:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,api:null,id:null},mutations:{},getters:{},actions:{}},growl:{state:{enabled:null,host:null,password:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},mutations:{},getters:{},actions:{}},kodi:{state:{enabled:null,alwaysOn:null,libraryCleanPending:null,cleanLibrary:null,host:[],username:null,password:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,update:{library:null,full:null,onlyFirst:null}},mutations:{},getters:{},actions:{}},libnotify:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},mutations:{},getters:{},actions:{}},nmj:{state:{enabled:null,host:null,database:null,mount:null},mutations:{},getters:{},actions:{}},nmjv2:{state:{enabled:null,host:null,dbloc:null,database:null},mutations:{},getters:{},actions:{}},plex:{state:{client:{host:[],username:null,enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},server:{updateLibrary:null,host:[],enabled:null,https:null,username:null,password:null,token:null}},mutations:{},getters:{},actions:{}},prowl:{state:{enabled:null,api:[],messageTitle:null,priority:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},mutations:{},getters:{},actions:{}},pushalot:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,authToken:null},mutations:{},getters:{},actions:{}},pushbullet:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,authToken:null,device:null},mutations:{},getters:{},actions:{}},join:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,api:null,device:null},mutations:{},getters:{},actions:{}},pushover:{state:{enabled:null,apiKey:null,userKey:null,device:[],sound:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},mutations:{},getters:{},actions:{}},pyTivo:{state:{enabled:null,host:null,name:null,shareName:null},mutations:{},getters:{},actions:{}},slack:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,webhook:null},mutations:{},getters:{},actions:{}},synology:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null},mutations:{},getters:{},actions:{}},synologyIndex:{state:{enabled:null},mutations:{},getters:{},actions:{}},telegram:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,api:null,id:null},mutations:{},getters:{},actions:{}},trakt:{state:{enabled:null,pinUrl:null,username:null,accessToken:null,timeout:null,defaultIndexer:null,sync:null,syncRemove:null,syncWatchlist:null,methodAdd:null,removeWatchlist:null,removeSerieslist:null,removeShowFromApplication:null,startPaused:null,blacklistName:null},mutations:{},getters:{},actions:{}},twitter:{state:{enabled:null,notifyOnSnatch:null,notifyOnDownload:null,notifyOnSubtitleDownload:null,dmto:null,prefix:null,directMessage:null},mutations:{},getters:{},actions:{}}}};var x={state:{naming:{pattern:null,multiEp:null,enableCustomNamingSports:null,enableCustomNamingAirByDate:null,patternSports:null,patternAirByDate:null,enableCustomNamingAnime:null,patternAnime:null,animeMultiEp:null,animeNamingType:null,stripYear:null},showDownloadDir:null,processAutomatically:null,processMethod:null,deleteRarContent:null,unpack:null,noDelete:null,reflinkAvailable:null,postponeIfSyncFiles:null,autoPostprocessorFrequency:10,airdateEpisodes:null,moveAssociatedFiles:null,allowedExtensions:[],addShowsWithoutDir:null,createMissingShowDirs:null,renameEpisodes:null,postponeIfNoSubs:null,nfoRename:null,syncFiles:[],fileTimestampTimezone:"local",extraScripts:[],extraScriptsUrl:null,multiEpStrings:{}},mutations:{[r](e,{section:t,config:n}){"postprocessing"===t&&(e=Object.assign(e,n))}},getters:{},actions:{}};var k={state:{filters:{ignoreUnknownSubs:!1,ignored:["german","french","core2hd","dutch","swedish","reenc","MrLss","dubbed"],undesired:["internal","xvid"],ignoredSubsList:["dk","fin","heb","kor","nor","nordic","pl","swe"],required:[],preferred:[]},general:{minDailySearchFrequency:10,minBacklogFrequency:720,dailySearchFrequency:40,checkPropersInterval:"4h",usenetRetention:500,maxCacheAge:30,backlogDays:7,torrentCheckerFrequency:60,backlogFrequency:720,cacheTrimming:!1,downloadPropers:!0,failedDownloads:{enabled:null,deleteFailed:null},minTorrentCheckerFrequency:30,removeFromClient:!1,randomizeProviders:!1,propersSearchDays:2,allowHighPriority:!0,trackersList:["udp://tracker.coppersurfer.tk:6969/announce","udp://tracker.leechers-paradise.org:6969/announce","udp://tracker.zer0day.to:1337/announce","udp://tracker.opentrackr.org:1337/announce","http://tracker.opentrackr.org:1337/announce","udp://p4p.arenabg.com:1337/announce","http://p4p.arenabg.com:1337/announce","udp://explodie.org:6969/announce","udp://9.rarbg.com:2710/announce","http://explodie.org:6969/announce","http://tracker.dler.org:6969/announce","udp://public.popcorn-tracker.org:6969/announce","udp://tracker.internetwarriors.net:1337/announce","udp://ipv4.tracker.harry.lu:80/announce","http://ipv4.tracker.harry.lu:80/announce","udp://mgtracker.org:2710/announce","http://mgtracker.org:6969/announce","udp://tracker.mg64.net:6969/announce","http://tracker.mg64.net:6881/announce","http://torrentsmd.com:8080/announce"]}},mutations:{[r](e,{section:t,config:n}){"search"===t&&(e=Object.assign(e,n))}},getters:{},actions:{}},S=n(4),C=n.n(S);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var P={state:{shows:[],currentShow:{indexer:null,id:null}},mutations:{[l](e,t){const n=e.shows.find(({id:e,indexer:n})=>Number(t.id[t.indexer])===Number(e[n]));if(!n)return console.debug("Adding ".concat(t.title||t.indexer+String(t.id)," as it wasn't found in the shows array"),t),void e.shows.push(t);console.debug("Found ".concat(t.title||t.indexer+String(t.id)," in shows array attempting merge"));const a=function(e){for(var t=1;tNumber(t.id[t.indexer])===Number(e[n])));a.seasons||(a.seasons=[]),n.forEach(e=>{const t=a.seasons.find(t=>t.season===e.season);if(t){const n=t.episodes.findIndex(t=>t.slug===e.slug);-1===n?t.episodes.push(e):t.episodes.splice(n,1,e)}else{const t={season:e.season,episodes:[],html:!1,mode:"span",label:1};a.seasons.push(t),t.episodes.push(e)}});const o=e.shows.find(({id:e,indexer:n})=>Number(t.id[t.indexer])===Number(e[n]));s.a.set(e.shows,e.shows.indexOf(o),a),console.log("Storing episodes for show ".concat(a.title," seasons: ").concat([...new Set(n.map(e=>e.season))].join(", ")))}},getters:{getShowById:e=>{return({id:t,indexer:n})=>e.shows.find(e=>Number(e.id[n])===Number(t))},getShowByTitle:e=>t=>e.shows.find(e=>e.title===t),getSeason:e=>({id:t,indexer:n,season:s})=>{const a=e.shows.find(e=>Number(e.id[n])===Number(t));return a&&a.seasons?a.seasons[s]:void 0},getEpisode:e=>({id:t,indexer:n,season:s,episode:a})=>{const o=e.shows.find(e=>Number(e.id[n])===Number(t));return o&&o.seasons&&o.seasons[s]?o.seasons[s][a]:void 0},getCurrentShow:(e,t,n)=>e.shows.find(t=>Number(t.id[e.currentShow.indexer])===Number(e.currentShow.id))||n.defaults.show},actions:{getShow:(e,{indexer:t,id:n,detailed:s,episodes:a})=>new Promise((o,i)=>{const{commit:r}=e,c={};let d=3e4;void 0!==s&&(c.detailed=s,d=6e4,d=6e4),void 0!==a&&(c.episodes=a,d=6e4),p.a.get("/series/".concat(t).concat(n),{params:c,timeout:d}).then(e=>{r(l,e.data),o(e.data)}).catch(e=>{i(e)})}),getEpisodes:({commit:e,getters:t},{indexer:n,id:s,season:a})=>new Promise((o,i)=>{const{getShowById:r}=t,l=r({id:s,indexer:n}),c={limit:1e3};a&&(c.season=a),p.a.get("/series/".concat(n).concat(s,"/episodes"),{params:c}).then(t=>{e("📺 Shows season with episodes added to store",{show:l,episodes:t.data}),o()}).catch(e=>{console.log("Could not retrieve a episodes for show ".concat(n).concat(s,", error: ").concat(e)),i(e)})}),getShows(e,t){const{commit:n,dispatch:s}=e;return t?t.forEach(e=>s("getShow",e)):(()=>{const e={limit:1e3,page:1};p.a.get("/series",{params:e}).then(t=>{const s=Number(t.headers["x-pagination-total"]);t.data.forEach(e=>{n(l,e)});const a=[];for(let t=2;t<=s;t++){const s={page:t};s.limit=e.limit,a.push(p.a.get("/series",{params:s}).then(e=>{e.data.forEach(e=>{n(l,e)})}))}return Promise.all(a)}).catch(()=>{console.log("Could not retrieve a list of shows")})})()},setShow:(e,{indexer:t,id:n,data:s})=>p.a.patch("series/".concat(t).concat(n),s),updateShow(e,t){const{commit:n}=e;return n(l,t)}}};var E={state:{isConnected:!1,message:{},messages:[],reconnectError:!1},mutations:{"🔗 ✅ WebSocket connected"(e){e.isConnected=!0},"🔗 ❌ WebSocket disconnected"(e){e.isConnected=!1},"🔗 ❌ WebSocket error"(e,t){console.error(e,t)},"🔗 ✉️ 📥 WebSocket message received"(e,t){const{data:n,event:s}=t;if(e.message=t,"notification"===s){const s=e.messages.filter(e=>e.hash===n.hash);1===s.length?e.messages[e.messages.indexOf(s)]=t:e.messages.push(t)}},"🔗 🔃 WebSocket reconnecting"(e,t){console.info(e,t)},"🔗 🔃 ❌ WebSocket reconnection attempt failed"(e){e.reconnectError=!0;let t="";t+="Please check your network connection. ",t+="If you are using a reverse proxy, please take a look at our wiki for config examples.",window.displayNotification("notice","Error connecting to websocket","Please check your network connection. If you are using a reverse proxy, please take a look at our wiki for config examples.")}},getters:{},actions:{}};var D={state:{overall:{episodes:{downloaded:null,snatched:null,total:null},shows:{active:null,total:null}}},mutations:{[c](e,t){const{type:n,stats:s}=t;e[n]=Object.assign(e[n],s)}},getters:{},actions:{getStats(e,t){const{commit:n}=e;return p.a.get("/stats/"+(t||"")).then(e=>{n(c,{type:t||"overall",stats:e.data})})}}};var T={state:{branch:null,memoryUsage:null,schedulers:[],showQueue:[],sslVersion:null,pythonVersion:null,pid:null,os:null,logDir:null,dbPath:null,configFile:null,databaseVersion:{major:null,minor:null},locale:null,localUser:null,programDir:null,dataDir:null,cacheDir:null,appArgs:[],webRoot:null,runsInDocker:null,gitRemoteBranches:[],cpuPresets:null,news:{lastRead:null,latest:null,unread:null}},mutations:{[r](e,{section:t,config:n}){"system"===t&&(e=Object.assign(e,n))}},getters:{getScheduler:e=>{return t=>e.schedulers.find(e=>t===e.key)||{}}},actions:{}};s.a.use(a.b);const N=new a.a({modules:{auth:d,clients:u,config:f,consts:m,defaults:g,indexers:v,layout:b,metadata:_,notifications:w,notifiers:y,postprocessing:x,search:k,shows:P,socket:E,stats:D,system:T},state:{},mutations:{},getters:{},actions:{}}),A=(()=>{const{protocol:e,host:t}=window.location,n="https:"===e?"wss:":"ws:",s=document.body.getAttribute("web-root");return"".concat(n,"//").concat(t).concat(s,"/ws").concat("/ui")})();s.a.use(i.a,A,{store:N,format:"json",reconnection:!0,reconnectionAttempts:2,reconnectionDelay:1e3,passToStoreHandler:function(e,t,n){const s=e.toUpperCase(),a=t.data;if("SOCKET_ONMESSAGE"===s){const e=JSON.parse(a),{data:t,event:n}=e;if("notification"===n){const{body:e,hash:n,type:s,title:a}=t;window.displayNotification(s,a,e,n)}else if("configUpdated"===n){const{section:e,config:n}=t;this.store.dispatch("updateConfig",{section:e,config:n})}else"showUpdated"===n?this.store.dispatch("updateShow",t):window.displayNotification("info",n,t)}n(e,t)},mutations:{SOCKET_ONOPEN:"🔗 ✅ WebSocket connected",SOCKET_ONCLOSE:"🔗 ❌ WebSocket disconnected",SOCKET_ONERROR:"🔗 ❌ WebSocket error",SOCKET_ONMESSAGE:"🔗 ✉️ 📥 WebSocket message received",SOCKET_RECONNECT:"🔗 🔃 WebSocket reconnecting",SOCKET_RECONNECT_ERROR:"🔗 🔃 ❌ WebSocket reconnection attempt failed"}});t.a=N},,,function(e,t,n){"use strict";var s=n(9),a=n(93);const o=[{title:"General",path:"config/general/",icon:"menu-icon-config"},{title:"Backup/Restore",path:"config/backuprestore/",icon:"menu-icon-backup"},{title:"Search Settings",path:"config/search/",icon:"menu-icon-manage-searches"},{title:"Search Providers",path:"config/providers/",icon:"menu-icon-provider"},{title:"Subtitles Settings",path:"config/subtitles/",icon:"menu-icon-backlog"},{title:"Post Processing",path:"config/postProcessing/",icon:"menu-icon-postprocess"},{title:"Notifications",path:"config/notifications/",icon:"menu-icon-notification"},{title:"Anime",path:"config/anime/",icon:"menu-icon-anime"}],i=e=>{const{$route:t,$store:n}=e,{config:s,notifiers:a}=n.state,o=t.params.indexer||t.query.indexername,i=t.params.id||t.query.seriesid,r=n.getters.getCurrentShow,{showQueueStatus:l}=r,c=e=>!!l&&Boolean(l.find(t=>t.action===e&&!0===t.active)),d=c("isBeingAdded"),u=c("isBeingUpdated"),p=c("isBeingSubtitled");let h=[{title:"Edit",path:"home/editShow?indexername=".concat(o,"&seriesid=").concat(i),icon:"ui-icon ui-icon-pencil"}];return d||u||(h=h.concat([{title:r.config.paused?"Resume":"Pause",path:"home/togglePause?indexername=".concat(o,"&seriesid=").concat(i),icon:"ui-icon ui-icon-".concat(r.config.paused?"play":"pause")},{title:"Remove",path:"home/deleteShow?indexername=".concat(o,"&seriesid=").concat(i),confirm:"removeshow",icon:"ui-icon ui-icon-trash"},{title:"Re-scan files",path:"home/refreshShow?indexername=".concat(o,"&seriesid=").concat(i),icon:"ui-icon ui-icon-refresh"},{title:"Force Full Update",path:"home/updateShow?indexername=".concat(o,"&seriesid=").concat(i),icon:"ui-icon ui-icon-transfer-e-w"},{title:"Update show in KODI",path:"home/updateKODI?indexername=".concat(o,"&seriesid=").concat(i),requires:a.kodi.enabled&&a.kodi.update.library,icon:"menu-icon-kodi"},{title:"Update show in Emby",path:"home/updateEMBY?indexername=".concat(o,"&seriesid=").concat(i),requires:a.emby.enabled,icon:"menu-icon-emby"},{title:"Preview Rename",path:"home/testRename?indexername=".concat(o,"&seriesid=").concat(i),icon:"ui-icon ui-icon-tag"},{title:"Download Subtitles",path:"home/subtitleShow?indexername=".concat(o,"&seriesid=").concat(i),requires:s.subtitles.enabled&&!p&&r.config.subtitlesEnabled,icon:"menu-icon-backlog"}])),h};var r=[...[{path:"/home",name:"home",meta:{title:"Home",header:"Show List",topMenu:"home"}},{path:"/home/editShow",name:"editShow",meta:{topMenu:"home",subMenu:i},component:()=>Promise.resolve().then(n.bind(null,119))},{path:"/home/displayShow",name:"show",meta:{topMenu:"home",subMenu:i},component:()=>Promise.resolve().then(n.bind(null,121))},{path:"/home/snatchSelection",name:"snatchSelection",meta:{topMenu:"home",subMenu:i}},{path:"/home/testRename",name:"testRename",meta:{title:"Preview Rename",header:"Preview Rename",topMenu:"home"}},{path:"/home/postprocess",name:"postprocess",meta:{title:"Manual Post-Processing",header:"Manual Post-Processing",topMenu:"home"}},{path:"/home/status",name:"status",meta:{title:"Status",topMenu:"system"}},{path:"/home/restart",name:"restart",meta:{title:"Restarting...",header:"Performing Restart",topMenu:"system"}},{path:"/home/shutdown",name:"shutdown",meta:{header:"Shutting down",topMenu:"system"}},{path:"/home/update",name:"update",meta:{topMenu:"system"}}],...[{path:"/config",name:"config",meta:{title:"Help & Info",header:"Medusa Configuration",topMenu:"config",subMenu:o,converted:!0},component:()=>Promise.resolve().then(n.bind(null,113))},{path:"/config/anime",name:"configAnime",meta:{title:"Config - Anime",header:"Anime",topMenu:"config",subMenu:o}},{path:"/config/backuprestore",name:"configBackupRestore",meta:{title:"Config - Backup/Restore",header:"Backup/Restore",topMenu:"config",subMenu:o}},{path:"/config/general",name:"configGeneral",meta:{title:"Config - General",header:"General Configuration",topMenu:"config",subMenu:o,converted:!0},component:()=>Promise.resolve().then(n.bind(null,122))},{path:"/config/notifications",name:"configNotifications",meta:{title:"Config - Notifications",header:"Notifications",topMenu:"config",subMenu:o,converted:!0},component:()=>Promise.resolve().then(n.bind(null,123))},{path:"/config/postProcessing",name:"configPostProcessing",meta:{title:"Config - Post Processing",header:"Post Processing",topMenu:"config",subMenu:o,converted:!0},component:()=>Promise.resolve().then(n.bind(null,120))},{path:"/config/providers",name:"configSearchProviders",meta:{title:"Config - Providers",header:"Search Providers",topMenu:"config",subMenu:o}},{path:"/config/search",name:"configSearchSettings",meta:{title:"Config - Episode Search",header:"Search Settings",topMenu:"config",subMenu:o,converted:!0},component:()=>Promise.resolve().then(n.bind(null,118))},{path:"/config/subtitles",name:"configSubtitles",meta:{title:"Config - Subtitles",header:"Subtitles",topMenu:"config",subMenu:o}}],...[{path:"/addShows",name:"addShows",meta:{title:"Add Shows",header:"Add Shows",topMenu:"home",converted:!0},component:()=>Promise.resolve().then(n.bind(null,115))},{path:"/addShows/addExistingShows",name:"addExistingShows",meta:{title:"Add Existing Shows",header:"Add Existing Shows",topMenu:"home"}},{path:"/addShows/newShow",name:"addNewShow",meta:{title:"Add New Show",header:"Add New Show",topMenu:"home"}},{path:"/addShows/trendingShows",name:"addTrendingShows",meta:{topMenu:"home"}},{path:"/addShows/popularShows",name:"addPopularShows",meta:{title:"Popular Shows",header:"Popular Shows",topMenu:"home"}},{path:"/addShows/popularAnime",name:"addPopularAnime",meta:{title:"Popular Anime Shows",header:"Popular Anime Shows",topMenu:"home"}}],{path:"/login",name:"login",meta:{title:"Login"},component:()=>Promise.resolve().then(n.bind(null,116))},{path:"/addRecommended",name:"addRecommended",meta:{title:"Add Recommended Shows",header:"Add Recommended Shows",topMenu:"home",converted:!0},component:()=>Promise.resolve().then(n.bind(null,114))},{path:"/schedule",name:"schedule",meta:{title:"Schedule",header:"Schedule",topMenu:"schedule"}},{path:"/history",name:"history",meta:{title:"History",header:"History",topMenu:"history",subMenu:[{title:"Clear History",path:"history/clearHistory",icon:"ui-icon ui-icon-trash",confirm:"clearhistory"},{title:"Trim History",path:"history/trimHistory",icon:"menu-icon-cut",confirm:"trimhistory"}]}},{path:"/manage",name:"manage",meta:{title:"Mass Update",header:"Mass Update",topMenu:"manage"}},{path:"/manage/backlogOverview",name:"manageBacklogOverview",meta:{title:"Backlog Overview",header:"Backlog Overview",topMenu:"manage"}},{path:"/manage/episodeStatuses",name:"manageEpisodeOverview",meta:{title:"Episode Overview",header:"Episode Overview",topMenu:"manage"}},{path:"/manage/failedDownloads",name:"manageFailedDownloads",meta:{title:"Failed Downloads",header:"Failed Downloads",topMenu:"manage"}},{path:"/manage/manageSearches",name:"manageManageSearches",meta:{title:"Manage Searches",header:"Manage Searches",topMenu:"manage"}},{path:"/manage/massEdit",name:"manageMassEdit",meta:{title:"Mass Edit",topMenu:"manage"}},{path:"/manage/subtitleMissed",name:"manageSubtitleMissed",meta:{title:"Missing Subtitles",header:"Missing Subtitles",topMenu:"manage"}},{path:"/manage/subtitleMissedPP",name:"manageSubtitleMissedPP",meta:{title:"Missing Subtitles in Post-Process folder",header:"Missing Subtitles in Post-Process folder",topMenu:"manage"}},...[{path:"/errorlogs",name:"errorlogs",meta:{title:"Logs & Errors",topMenu:"system",subMenu:e=>{const{$route:t,$store:n}=e,s=t.params.level||t.query.level,{config:a}=n.state,{loggingLevels:o,numErrors:i,numWarnings:r}=a.logs;if(0===Object.keys(o).length)return[];const l=void 0===s||Number(s)===o.error;return[{title:"Clear Errors",path:"errorlogs/clearerrors/",requires:i>=1&&l,icon:"ui-icon ui-icon-trash"},{title:"Clear Warnings",path:"errorlogs/clearerrors/?level=".concat(o.warning),requires:r>=1&&Number(s)===o.warning,icon:"ui-icon ui-icon-trash"},{title:"Submit Errors",path:"errorlogs/submit_errors/",requires:i>=1&&l,confirm:"submiterrors",icon:"ui-icon ui-icon-arrowreturnthick-1-n"}]}}},{path:"/errorlogs/viewlog",name:"viewlog",meta:{title:"Logs",header:"Log File",topMenu:"system",converted:!0},component:()=>Promise.resolve().then(n.bind(null,117))}],{path:"/news",name:"news",meta:{title:"News",header:"News",topMenu:"system"}},{path:"/changes",name:"changes",meta:{title:"Changelog",header:"Changelog",topMenu:"system"}},{path:"/IRC",name:"IRC",meta:{title:"IRC",topMenu:"system",converted:!0},component:()=>Promise.resolve().then(n.bind(null,111))},{path:"/not-found",name:"not-found",meta:{title:"404",header:"404 - page not found"},component:()=>Promise.resolve().then(n.bind(null,112))}];n.d(t,"a",function(){return l}),s.a.use(a.a);const l=document.body.getAttribute("web-root")+"/",c=new a.a({base:l,mode:"history",routes:r});c.beforeEach((e,t,n)=>{const{meta:s}=e,{title:a}=s;a&&(document.title="".concat(a," | Medusa")),n()});t.b=c},function(e,t,n){"use strict";var s=n(4),a=n.n(s),o=n(1),i=n(3);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var l={name:"anidb-release-group-ui",components:{StateSwitch:n(2).p},props:{showName:{type:String,required:!0},blacklist:{type:Array,default:()=>[]},whitelist:{type:Array,default:()=>[]}},data:()=>({index:0,allReleaseGroups:[],newGroup:"",fetchingGroups:!1,remoteGroups:[]}),mounted(){this.createIndexedObjects(this.blacklist,"blacklist"),this.createIndexedObjects(this.whitelist,"whitelist"),this.createIndexedObjects(this.remoteGroups,"releasegroups"),this.fetchGroups()},methods:{async fetchGroups(){const{showName:e}=this;if(!e)return;this.fetchingGroups=!0,console.log("Fetching release groups");const t={series_name:e};try{const{data:n}=await i.c.get("home/fetch_releasegroups",{params:t,timeout:3e4});if("success"!==n.result)throw new Error("Failed to get release groups, check server logs for errors.");this.remoteGroups=n.groups||[]}catch(t){const n='Error while trying to fetch release groups for show "'.concat(e,'": ').concat(t||"Unknown");this.$snotify.warning(n,"Error"),console.error(n)}finally{this.fetchingGroups=!1}},toggleItem(e){this.allReleaseGroups=this.allReleaseGroups.map(t=>(t.id===e.id&&(t.toggled=!t.toggled),t))},createIndexedObjects(e,t){for(let n of e){"string"==typeof n&&(n={name:n});const e=Object.assign({id:this.index,toggled:!1,memberOf:t},n);0===this.allReleaseGroups.filter(n=>n.name===e.name&&n.memberOf===t).length&&(this.allReleaseGroups.push(e),this.index+=1)}},moveToList(e){for(const t of this.allReleaseGroups){const n=void 0!==this.allReleaseGroups.find(n=>n.memberOf===e&&n.name===t.name);t.toggled&&!n&&(t.toggled=!1,t.memberOf=e)}this.newGroup&&"releasegroups"!==e&&(this.allReleaseGroups.push({id:this.index,name:this.newGroup,toggled:!1,memberOf:e}),this.index+=1,this.newGroup="")},deleteFromList(e){this.allReleaseGroups=this.allReleaseGroups.filter(t=>t.memberOf!==e||!t.toggled)}},computed:function(e){for(var t=1;t"whitelist"===e.memberOf)},itemsBlacklist(){return this.allReleaseGroups.filter(e=>"blacklist"===e.memberOf)},itemsReleaseGroups(){return this.allReleaseGroups.filter(e=>"releasegroups"===e.memberOf)},showDeleteFromWhitelist(){return 0!==this.allReleaseGroups.filter(e=>"whitelist"===e.memberOf&&!0===e.toggled).length},showDeleteFromBlacklist(){return 0!==this.allReleaseGroups.filter(e=>"blacklist"===e.memberOf&&!0===e.toggled).length}}),watch:{showName(){this.fetchGroups()},allReleaseGroups:{deep:!0,handler(e){const t={whitelist:[],blacklist:[]};e.forEach(e=>{Object.keys(t).includes(e.memberOf)&&t[e.memberOf].push(e.name)}),this.$emit("change",t)}},remoteGroups(e){this.createIndexedObjects(e,"releasegroups")}}},c=(n(212),n(0)),d=Object(c.a)(l,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"anidb-release-group-ui-wrapper top-10 max-width"},[e.fetchingGroups?[n("state-switch",{attrs:{state:"loading",theme:e.layout.themeName}}),e._v(" "),n("span",[e._v("Fetching release groups...")])]:n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-4 left-whitelist"},[n("span",[e._v("Whitelist")]),e.showDeleteFromWhitelist?n("img",{staticClass:"deleteFromWhitelist",attrs:{src:"images/no16.png"},on:{click:function(t){return e.deleteFromList("whitelist")}}}):e._e(),e._v(" "),n("ul",[e._l(e.itemsWhitelist,function(t){return n("li",{key:t.id,class:{active:t.toggled},on:{click:function(e){t.toggled=!t.toggled}}},[e._v(e._s(t.name))])}),e._v(" "),n("div",{staticClass:"arrow",on:{click:function(t){return e.moveToList("whitelist")}}},[n("img",{attrs:{src:"images/curved-arrow-left.png"}})])],2)]),e._v(" "),n("div",{staticClass:"col-sm-4 center-available"},[n("span",[e._v("Release groups")]),e._v(" "),n("ul",[e._l(e.itemsReleaseGroups,function(t){return n("li",{key:t.id,staticClass:"initial",class:{active:t.toggled},on:{click:function(e){t.toggled=!t.toggled}}},[e._v(e._s(t.name))])}),e._v(" "),n("div",{staticClass:"arrow",on:{click:function(t){return e.moveToList("releasegroups")}}},[n("img",{attrs:{src:"images/curved-arrow-left.png"}})])],2)]),e._v(" "),n("div",{staticClass:"col-sm-4 right-blacklist"},[n("span",[e._v("Blacklist")]),e.showDeleteFromBlacklist?n("img",{staticClass:"deleteFromBlacklist",attrs:{src:"images/no16.png"},on:{click:function(t){return e.deleteFromList("blacklist")}}}):e._e(),e._v(" "),n("ul",[e._l(e.itemsBlacklist,function(t){return n("li",{key:t.id,class:{active:t.toggled},on:{click:function(e){t.toggled=!t.toggled}}},[e._v(e._s(t.name))])}),e._v(" "),n("div",{staticClass:"arrow",on:{click:function(t){return e.moveToList("blacklist")}}},[n("img",{attrs:{src:"images/curved-arrow-left.png"}})])],2)])]),e._v(" "),n("div",{staticClass:"row",attrs:{id:"add-new-release-group"}},[n("div",{staticClass:"col-md-4"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newGroup,expression:"newGroup"}],staticClass:"form-control input-sm",attrs:{type:"text",placeholder:"add custom group"},domProps:{value:e.newGroup},on:{input:function(t){t.target.composing||(e.newGroup=t.target.value)}}})]),e._v(" "),e._m(0)])],2)},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"col-md-8"},[t("p",[this._v("Use the input to add custom whitelist / blacklist release groups. Click on the "),t("img",{attrs:{src:"images/curved-arrow-left.png"}}),this._v(" to add it to the correct list.")])])}],!1,null,"b388ff58",null);t.a=d.exports},function(e,t,n){"use strict";var s=n(62).a,a=(n(228),n(0)),o=Object(a.a)(s,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"show-header-container"},[n("div",{staticClass:"row"},[e.show?n("div",{staticClass:"col-lg-12",attrs:{id:"showtitle","data-showname":e.show.title}},[n("div",[n("h1",{staticClass:"title",attrs:{"data-indexer-name":e.show.indexer,"data-series-id":e.show.id[e.show.indexer],id:"scene_exception_"+e.show.id[e.show.indexer]}},[n("app-link",{staticClass:"snatchTitle",attrs:{href:"home/displayShow?indexername="+e.show.indexer+"&seriesid="+e.show.id[e.show.indexer]}},[e._v(e._s(e.show.title))])],1)]),e._v(" "),"snatch-selection"===e.type?n("div",{staticClass:"pull-right",attrs:{id:"show-specials-and-seasons"}},[n("span",{staticClass:"h2footer display-specials"},[e._v("\n Manual search for:"),n("br"),e._v(" "),n("app-link",{staticClass:"snatchTitle",attrs:{href:"home/displayShow?indexername="+e.show.indexer+"&seriesid="+e.show.id[e.show.indexer]}},[e._v(e._s(e.show.title))]),e._v(" / Season "+e._s(e.season)),void 0!==e.episode&&"season"!==e.manualSearchType?[e._v(" Episode "+e._s(e.episode))]:e._e()],2)]):e._e(),e._v(" "),"snatch-selection"!==e.type&&e.seasons.length>=1?n("div",{staticClass:"pull-right",attrs:{id:"show-specials-and-seasons"}},[e.seasons.includes(0)?n("span",{staticClass:"h2footer display-specials"},[e._v("\n Display Specials: "),n("a",{staticClass:"inner",staticStyle:{cursor:"pointer"},on:{click:function(t){return t.preventDefault(),e.toggleSpecials()}}},[e._v(e._s(e.displaySpecials?"Hide":"Show"))])]):e._e(),e._v(" "),n("div",{staticClass:"h2footer display-seasons clear"},[n("span",[e.seasons.length>=15?n("select",{directives:[{name:"model",rawName:"v-model",value:e.jumpToSeason,expression:"jumpToSeason"}],staticClass:"form-control input-sm",staticStyle:{position:"relative"},attrs:{id:"seasonJump"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.jumpToSeason=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"jump"}},[e._v("Jump to Season")]),e._v(" "),e._l(e.seasons,function(t){return n("option",{key:"jumpToSeason-"+t,domProps:{value:t}},[e._v("\n "+e._s(0===t?"Specials":"Season "+t)+"\n ")])})],2):e.seasons.length>=1?[e._v("\n Season:\n "),e._l(e.reverse(e.seasons),function(t,s){return[n("app-link",{key:"jumpToSeason-"+t,attrs:{href:"#season-"+t},nativeOn:{click:function(n){n.preventDefault(),e.jumpToSeason=t}}},[e._v("\n "+e._s(0===t?"Specials":t)+"\n ")]),e._v(" "),s!==e.seasons.length-1?n("span",{key:"separator-"+s,staticClass:"separator"},[e._v("| ")]):e._e()]})]:e._e()],2)])]):e._e()]):e._e()]),e._v(" "),e._l(e.activeShowQueueStatuses,function(t){return n("div",{key:t.action,staticClass:"row"},[n("div",{staticClass:"alert alert-info"},[e._v("\n "+e._s(t.message)+"\n ")])])}),e._v(" "),n("div",{staticClass:"row",attrs:{id:"row-show-summary"}},[n("div",{staticClass:"col-md-12",attrs:{id:"col-show-summary"}},[n("div",{staticClass:"show-poster-container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"image-flex-container col-md-12"},[n("asset",{attrs:{default:"images/poster.png","show-slug":e.show.id.slug,type:"posterThumb",cls:"show-image shadow",link:!0}})],1)])]),e._v(" "),n("div",{staticClass:"ver-spacer"}),e._v(" "),n("div",{staticClass:"show-info-container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"pull-right col-lg-3 col-md-3 hidden-sm hidden-xs"},[n("asset",{attrs:{default:"images/banner.png","show-slug":e.show.id.slug,type:"banner",cls:"show-banner pull-right shadow",link:!0}})],1),e._v(" "),n("div",{staticClass:"pull-left col-lg-9 col-md-9 col-sm-12 col-xs-12",attrs:{id:"show-rating"}},[e.show.rating.imdb&&e.show.rating.imdb.rating?n("span",{staticClass:"imdbstars",attrs:{"qtip-content":e.show.rating.imdb.rating+" / 10 Stars
"+e.show.rating.imdb.votes+" Votes"}},[n("span",{style:{width:10*Number(e.show.rating.imdb.rating)+"%"}})]):e._e(),e._v(" "),e.show.id.imdb?[e._l(e.show.countryCodes,function(e){return n("img",{key:"flag-"+e,class:["country-flag","flag-"+e],staticStyle:{"margin-left":"3px","vertical-align":"middle"},attrs:{src:"images/blank.png",width:"16",height:"11"}})}),e._v(" "),e.show.imdbInfo.year?n("span",[e._v("\n ("+e._s(e.show.imdbInfo.year)+") -\n ")]):e._e(),e._v(" "),n("span",[e._v("\n "+e._s(e.show.imdbInfo.runtimes||e.show.runtime)+" minutes\n ")]),e._v(" "),n("app-link",{attrs:{href:"https://www.imdb.com/title/"+e.show.id.imdb,title:"https://www.imdb.com/title/"+e.show.id.imdb}},[n("img",{staticStyle:{"margin-top":"-1px","vertical-align":"middle"},attrs:{alt:"[imdb]",height:"16",width:"16",src:"images/imdb.png"}})])]:[e.show.year.start?n("span",[e._v("("+e._s(e.show.year.start)+") - "+e._s(e.show.runtime)+" minutes - ")]):e._e()],e._v(" "),e.show.id.trakt?n("app-link",{attrs:{href:"https://trakt.tv/shows/"+e.show.id.trakt,title:"https://trakt.tv/shows/"+e.show.id.trakt}},[n("img",{attrs:{alt:"[trakt]",height:"16",width:"16",src:"images/trakt.png"}})]):e._e(),e._v(" "),e.showIndexerUrl&&e.indexerConfig[e.show.indexer].icon?n("app-link",{attrs:{href:e.showIndexerUrl,title:e.showIndexerUrl}},[n("img",{staticStyle:{"margin-top":"-1px","vertical-align":"middle"},attrs:{alt:e.indexerConfig[e.show.indexer].name,height:"16",width:"16",src:"images/"+e.indexerConfig[e.show.indexer].icon}})]):e._e(),e._v(" "),e.show.xemNumbering&&e.show.xemNumbering.length>0?n("app-link",{attrs:{href:"http://thexem.de/search?q="+e.show.title,title:"http://thexem.de/search?q="+e.show.title}},[n("img",{staticStyle:{"margin-top":"-1px","vertical-align":"middle"},attrs:{alt:"[xem]",height:"16",width:"16",src:"images/xem.png"}})]):e._e(),e._v(" "),e.show.id.tvdb?n("app-link",{attrs:{href:"https://fanart.tv/series/"+e.show.id.tvdb,title:"https://fanart.tv/series/"+e.show.id[e.show.indexer]}},[n("img",{staticClass:"fanart",attrs:{alt:"[fanart.tv]",height:"16",width:"16",src:"images/fanart.tv.png"}})]):e._e()],2),e._v(" "),n("div",{staticClass:"pull-left col-lg-9 col-md-9 col-sm-12 col-xs-12",attrs:{id:"tags"}},[e.show.genres?n("ul",{staticClass:"tags"},e._l(e.dedupeGenres(e.show.genres),function(t){return n("app-link",{key:t.toString(),attrs:{href:"https://trakt.tv/shows/popular/?genres="+t.toLowerCase().replace(" ","-"),title:"View other popular "+t+" shows on trakt.tv"}},[n("li",[e._v(e._s(t))])])}),1):n("ul",{staticClass:"tags"},e._l(e.showGenres,function(t){return n("app-link",{key:t.toString(),attrs:{href:"https://www.imdb.com/search/title?count=100&title_type=tv_series&genres="+t.toLowerCase().replace(" ","-"),title:"View other popular "+t+" shows on IMDB"}},[n("li",[e._v(e._s(t))])])}),1)])]),e._v(" "),n("div",{staticClass:"row"},[e.configLoaded?n("div",{staticClass:"col-md-12",attrs:{id:"summary"}},[n("div",{class:[{summaryFanArt:e.layout.fanartBackground},"col-lg-9","col-md-8","col-sm-8","col-xs-12"],attrs:{id:"show-summary"}},[n("table",{staticClass:"summaryTable pull-left"},[e.show.plot?n("tr",[n("td",{staticStyle:{"padding-bottom":"15px"},attrs:{colspan:"2"}},[n("truncate",{attrs:{length:250,clamp:"show more...",less:"show less...",text:e.show.plot},on:{toggle:function(t){return e.$emit("reflow")}}})],1)]):e._e(),e._v(" "),void 0!==e.getQualityPreset({value:e.combinedQualities})?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Quality:")]),e._v(" "),n("td",[n("quality-pill",{attrs:{quality:e.combinedQualities}})],1)]):[e.combineQualities(e.show.config.qualities.allowed)>0?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Allowed Qualities:")]),e._v(" "),n("td",[e._l(e.show.config.qualities.allowed,function(t,s){return[e._v(e._s(s>0?", ":"")),n("quality-pill",{key:"allowed-"+t,attrs:{quality:t}})]})],2)]):e._e(),e._v(" "),e.combineQualities(e.show.config.qualities.preferred)>0?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Preferred Qualities:")]),e._v(" "),n("td",[e._l(e.show.config.qualities.preferred,function(t,s){return[e._v(e._s(s>0?", ":"")),n("quality-pill",{key:"preferred-"+t,attrs:{quality:t}})]})],2)]):e._e()],e._v(" "),e.show.network&&e.show.airs?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Originally Airs: ")]),n("td",[e._v(e._s(e.show.airs)),e.show.airsFormatValid?e._e():n("b",{staticClass:"invalid-value"},[e._v(" (invalid time format)")]),e._v(" on "+e._s(e.show.network))])]):e.show.network?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Originally Airs: ")]),n("td",[e._v(e._s(e.show.network))])]):e.show.airs?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Originally Airs: ")]),n("td",[e._v(e._s(e.show.airs)),e.show.airsFormatValid?e._e():n("b",{staticClass:"invalid-value"},[e._v(" (invalid time format)")])])]):e._e(),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Show Status: ")]),n("td",[e._v(e._s(e.show.status))])]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Default EP Status: ")]),n("td",[e._v(e._s(e.show.config.defaultEpisodeStatus))])]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[n("span",{class:{"invalid-value":!e.show.config.locationValid}},[e._v("Location: ")])]),n("td",[n("span",{class:{"invalid-value":!e.show.config.locationValid}},[e._v(e._s(e.show.config.location))]),e._v(e._s(e.show.config.locationValid?"":" (Missing)"))])]),e._v(" "),e.show.config.aliases.length>0?n("tr",[n("td",{staticClass:"showLegend",staticStyle:{"vertical-align":"top"}},[e._v("Scene Name:")]),e._v(" "),n("td",[e._v(e._s(e.show.config.aliases.join(", ")))])]):e._e(),e._v(" "),e.show.config.release.requiredWords.length+e.search.filters.required.length>0?n("tr",[n("td",{staticClass:"showLegend",staticStyle:{"vertical-align":"top"}},[n("span",{class:{required:"snatch-selection"===e.type}},[e._v("Required Words: ")])]),e._v(" "),n("td",[e.show.config.release.requiredWords.length?n("span",{staticClass:"break-word"},[e._v("\n "+e._s(e.show.config.release.requiredWords.join(", "))+"\n ")]):e._e(),e._v(" "),e.search.filters.required.length>0?n("span",{staticClass:"break-word global-filter"},[n("app-link",{attrs:{href:"config/search/#searchfilters"}},[e.show.config.release.requiredWords.length>0?[e.show.config.release.requiredWordsExclude?n("span",[e._v(" excluded from: ")]):n("span",[e._v("+ ")])]:e._e(),e._v("\n "+e._s(e.search.filters.required.join(", "))+"\n ")],2)],1):e._e()])]):e._e(),e._v(" "),e.show.config.release.ignoredWords.length+e.search.filters.ignored.length>0?n("tr",[n("td",{staticClass:"showLegend",staticStyle:{"vertical-align":"top"}},[n("span",{class:{ignored:"snatch-selection"===e.type}},[e._v("Ignored Words: ")])]),e._v(" "),n("td",[e.show.config.release.ignoredWords.length?n("span",{staticClass:"break-word"},[e._v("\n "+e._s(e.show.config.release.ignoredWords.join(", "))+"\n ")]):e._e(),e._v(" "),e.search.filters.ignored.length>0?n("span",{staticClass:"break-word global-filter"},[n("app-link",{attrs:{href:"config/search/#searchfilters"}},[e.show.config.release.ignoredWords.length>0?[e.show.config.release.ignoredWordsExclude?n("span",[e._v(" excluded from: ")]):n("span",[e._v("+ ")])]:e._e(),e._v("\n "+e._s(e.search.filters.ignored.join(", "))+"\n ")],2)],1):e._e()])]):e._e(),e._v(" "),e.search.filters.preferred.length>0?n("tr",[n("td",{staticClass:"showLegend",staticStyle:{"vertical-align":"top"}},[n("span",{class:{preferred:"snatch-selection"===e.type}},[e._v("Preferred Words: ")])]),e._v(" "),n("td",[n("app-link",{attrs:{href:"config/search/#searchfilters"}},[n("span",{staticClass:"break-word"},[e._v(e._s(e.search.filters.preferred.join(", ")))])])],1)]):e._e(),e._v(" "),e.search.filters.undesired.length>0?n("tr",[n("td",{staticClass:"showLegend",staticStyle:{"vertical-align":"top"}},[n("span",{class:{undesired:"snatch-selection"===e.type}},[e._v("Undesired Words: ")])]),e._v(" "),n("td",[n("app-link",{attrs:{href:"config/search/#searchfilters"}},[n("span",{staticClass:"break-word"},[e._v(e._s(e.search.filters.undesired.join(", ")))])])],1)]):e._e(),e._v(" "),e.show.config.release.whitelist&&e.show.config.release.whitelist.length>0?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Wanted Groups:")]),e._v(" "),n("td",[e._v(e._s(e.show.config.release.whitelist.join(", ")))])]):e._e(),e._v(" "),e.show.config.release.blacklist&&e.show.config.release.blacklist.length>0?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Unwanted Groups:")]),e._v(" "),n("td",[e._v(e._s(e.show.config.release.blacklist.join(", ")))])]):e._e(),e._v(" "),0!==e.show.config.airdateOffset?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Daily search offset:")]),e._v(" "),n("td",[e._v(e._s(e.show.config.airdateOffset)+" hours")])]):e._e(),e._v(" "),e.show.config.locationValid&&e.show.size>-1?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Size:")]),e._v(" "),n("td",[e._v(e._s(e.humanFileSize(e.show.size)))])]):e._e()],2)]),e._v(" "),n("div",{staticClass:"col-lg-3 col-md-4 col-sm-4 col-xs-12 pull-xs-left",attrs:{id:"show-status"}},[n("table",{staticClass:"pull-xs-left pull-md-right pull-sm-right pull-lg-right"},[e.show.language?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Info Language:")]),n("td",[n("img",{attrs:{src:"images/subtitles/flags/"+e.getCountryISO2ToISO3(e.show.language)+".png",width:"16",height:"11",alt:e.show.language,title:e.show.language,onError:"this.onerror=null;this.src='images/flags/unknown.png';"}})])]):e._e(),e._v(" "),e.config.subtitles.enabled?n("tr",[n("td",{staticClass:"showLegend"},[e._v("Subtitles: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.subtitlesEnabled},on:{click:function(t){return e.toggleConfigOption("subtitlesEnabled")}}})],1)]):e._e(),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Season Folders: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.seasonFolders||e.config.namingForceFolders}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Paused: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.paused},on:{click:function(t){return e.toggleConfigOption("paused")}}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Air-by-Date: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.airByDate},on:{click:function(t){return e.toggleConfigOption("airByDate")}}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Sports: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.sports},on:{click:function(t){return e.toggleConfigOption("sports")}}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Anime: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.anime},on:{click:function(t){return e.toggleConfigOption("anime")}}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("DVD Order: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.dvdOrder},on:{click:function(t){return e.toggleConfigOption("dvdOrder")}}})],1)]),e._v(" "),n("tr",[n("td",{staticClass:"showLegend"},[e._v("Scene Numbering: ")]),n("td",[n("state-switch",{attrs:{theme:e.layout.themeName,state:e.show.config.scene},on:{click:function(t){return e.toggleConfigOption("scene")}}})],1)])])])]):e._e()])])])]),e._v(" "),e.show?n("div",{staticClass:"row",attrs:{id:"row-show-episodes-controls"}},[n("div",{staticClass:"col-md-12",attrs:{id:"col-show-episodes-controls"}},["show"===e.type?n("div",{staticClass:"row key"},[n("div",{staticClass:"col-lg-12",attrs:{id:"checkboxControls"}},[e.show.seasons?n("div",{staticClass:"pull-left top-5",attrs:{id:"key-padding"}},e._l(e.overviewStatus,function(t){return n("label",{key:t.id,attrs:{for:t.id}},[n("span",{class:t.id},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.checked,expression:"status.checked"}],attrs:{type:"checkbox",id:t.id},domProps:{checked:Array.isArray(t.checked)?e._i(t.checked,null)>-1:t.checked},on:{change:[function(n){var s=t.checked,a=n.target,o=!!a.checked;if(Array.isArray(s)){var i=e._i(s,null);a.checked?i<0&&e.$set(t,"checked",s.concat([null])):i>-1&&e.$set(t,"checked",s.slice(0,i).concat(s.slice(i+1)))}else e.$set(t,"checked",o)},function(t){return e.$emit("update-overview-status",e.overviewStatus)}]}}),e._v("\n "+e._s(t.name)+": "),n("b",[e._v(e._s(e.episodeSummary[t.name]))])])])}),0):e._e(),e._v(" "),n("div",{staticClass:"pull-lg-right top-5"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedStatus,expression:"selectedStatus"}],staticClass:"form-control form-control-inline input-sm-custom input-sm-smallfont",attrs:{id:"statusSelect"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedStatus=t.target.multiple?n:n[0]}}},[n("option",{domProps:{value:"Change status to:"}},[e._v("Change status to:")]),e._v(" "),e._l(e.changeStatusOptions,function(t){return n("option",{key:t.key,domProps:{value:t.value}},[e._v("\n "+e._s(t.name)+"\n ")])})],2),e._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedQuality,expression:"selectedQuality"}],staticClass:"form-control form-control-inline input-sm-custom input-sm-smallfont",attrs:{id:"qualitySelect"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedQuality=t.target.multiple?n:n[0]}}},[n("option",{domProps:{value:"Change quality to:"}},[e._v("Change quality to:")]),e._v(" "),e._l(e.qualities,function(t){return n("option",{key:t.key,domProps:{value:t.value}},[e._v("\n "+e._s(t.name)+"\n ")])})],2),e._v(" "),n("input",{attrs:{type:"hidden",id:"series-slug"},domProps:{value:e.show.id.slug}}),e._v(" "),n("input",{attrs:{type:"hidden",id:"series-id"},domProps:{value:e.show.id[e.show.indexer]}}),e._v(" "),n("input",{attrs:{type:"hidden",id:"indexer"},domProps:{value:e.show.indexer}}),e._v(" "),n("input",{staticClass:"btn-medusa",attrs:{type:"button",id:"changeStatus",value:"Go"},on:{click:e.changeStatusClicked}})])])]):n("div")])]):e._e()],2)},[],!1,null,"b25c9a8a",null);t.a=o.exports},,,,,function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return i});var s=n(3);const a=()=>{e(".imdbstars").qtip({content:{text(){return e(this).attr("qtip-content")}},show:{solo:!0},position:{my:"right center",at:"center left",adjust:{y:0,x:-6}},style:{tip:{corner:!0,method:"polygon"},classes:"qtip-rounded qtip-shadow ui-tooltip-sb"}})},o=()=>{e(".addQTip").each((t,n)=>{e(n).css({cursor:"help","text-shadow":"0px 0px 0.5px #666"});const s=e(n).data("qtip-my")||"left center",a=e(n).data("qtip-at")||"middle right";e(n).qtip({show:{solo:!0},position:{my:s,at:a},style:{tip:{corner:!0,method:"polygon"},classes:"qtip-rounded qtip-shadow ui-tooltip-sb"}})})},i=(t,n)=>{if(e.fn.updateSearchIconsStarted||!t)return;e.fn.updateSearchIconsStarted=!0,e.fn.forcedSearches=[];const a=e=>{e.disabled=!0},o=()=>{let i=5e3;s.a.get("search/".concat(t)).then(t=>{i=t.data.results&&t.data.results.length>0?5e3:15e3,(t=>{e.each(t,(e,t)=>{if(t.show.slug!==n.show.id.slug)return!0;const s=n.$refs["search-".concat(t.episode.slug)];s&&("searching"===t.search.status.toLowerCase()?(s.title="Searching",s.alt="Searching",s.src="images/loading16.gif",a(s)):"queued"===t.search.status.toLowerCase()?(s.title="Queued",s.alt="queued",s.src="images/queued.png",a(s)):"finished"===t.search.status.toLowerCase()&&(s.title="Searching",s.alt="searching",s.src="images/search16.png",(e=>{e.disabled=!1})(s)))})})(t.data.results)}).catch(e=>{console.error(String(e)),i=3e4}).finally(()=>{setTimeout(o,i)})};o()}}).call(this,n(5))},function(e,t,n){"use strict";var s=n(9),a=n(125),o=n(126),i=n(128),r=n(94),l=n.n(r),c=n(129),d=n.n(c),u=n(23),p=(n(114),n(4)),h=n.n(p),f=n(1),m=n(6),g=n(2),v=n(26);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var _={name:"add-show-options",components:{AnidbReleaseGroupUi:v.a,ConfigToggleSlider:g.f,QualityChooser:g.k},props:{showName:{type:String,default:"",required:!1},enableAnimeOptions:{type:Boolean,default:!1}},data:()=>({saving:!1,selectedStatus:null,selectedStatusAfter:null,quality:{allowed:[],preferred:[]},selectedSubtitleEnabled:!1,selectedSeasonFoldersEnabled:!1,selectedAnimeEnabled:!1,selectedSceneEnabled:!1,release:{blacklist:[],whitelist:[]}}),mounted(){const{defaultConfig:e,update:t}=this;this.selectedStatus=e.status,this.selectedStatusAfter=e.statusAfter,this.$nextTick(()=>t()),this.$watch(e=>[e.selectedStatus,e.selectedStatusAfter,e.selectedSubtitleEnabled,e.selectedSeasonFoldersEnabled,e.selectedSceneEnabled,e.selectedAnimeEnabled].join(),()=>{this.update()})},methods:{update(){const{selectedSubtitleEnabled:e,selectedStatus:t,selectedStatusAfter:n,selectedSeasonFoldersEnabled:s,selectedAnimeEnabled:a,selectedSceneEnabled:o,release:i,quality:r}=this;this.$nextTick(()=>{this.$emit("change",{subtitles:e,status:t,statusAfter:n,seasonFolders:s,anime:a,scene:o,release:i,quality:r})})},onChangeReleaseGroupsAnime(e){this.release.whitelist=e.whitelist,this.release.blacklist=e.blacklist,this.update()},saveDefaults(){const{$store:e,selectedStatus:t,selectedStatusAfter:n,combinedQualities:s,selectedSubtitleEnabled:a,selectedSeasonFoldersEnabled:o,selectedAnimeEnabled:i,selectedSceneEnabled:r}=this,l={showDefaults:{status:t,statusAfter:n,quality:s,subtitles:a,seasonFolders:o,anime:i,scene:r}};this.saving=!0,e.dispatch("setConfig",{section:"main",config:l}).then(()=>{this.$snotify.success('Your "add show" defaults have been set to your current selections.',"Saved Defaults")}).catch(e=>{this.$snotify.error('Error while trying to save "add show" defaults: '+(e.message||"Unknown"),"Error")}).finally(()=>{this.saving=!1})}},computed:function(e){for(var t=1;te.config.showDefaults,namingForceFolders:e=>e.config.namingForceFolders,subtitlesEnabled:e=>e.config.subtitles.enabled,episodeStatuses:e=>e.consts.statuses}),{},Object(f.d)(["getStatus"]),{defaultEpisodeStatusOptions(){const{getStatus:e}=this;return 0===this.episodeStatuses.length?[]:["skipped","wanted","ignored"].map(t=>e({key:t}))},combinedQualities(){const{quality:e}=this,{allowed:t,preferred:n}=e;return Object(m.c)(t,n)},saveDefaultsDisabled(){const{enableAnimeOptions:e,defaultConfig:t,namingForceFolders:n,selectedStatus:s,selectedStatusAfter:a,combinedQualities:o,selectedSeasonFoldersEnabled:i,selectedSubtitleEnabled:r,selectedAnimeEnabled:l,selectedSceneEnabled:c}=this;return[s===t.status,a===t.statusAfter,o===t.quality,i===(t.seasonFolders||n),r===t.subtitles,!e||l===t.anime,c===t.scene].every(Boolean)}}),watch:{release:{handler(){this.$emit("refresh"),this.update()},deep:!0,immediate:!1},quality:{handler(){this.$emit("refresh"),this.update()},deep:!0,immediate:!1},selectedAnimeEnabled(){this.$emit("refresh"),this.update()},defaultConfig(e){const{namingForceFolders:t}=this;this.selectedStatus=e.status,this.selectedStatusAfter=e.statusAfter,this.selectedSubtitleEnabled=e.subtitles,this.selectedAnimeEnabled=e.anime,this.selectedSeasonFoldersEnabled=e.seasonFolders||t,this.selectedSceneEnabled=e.scene}}},w=n(0),y=Object(w.a)(_,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"add-show-options-content"}},[n("fieldset",{staticClass:"component-group-list"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[e._m(0),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("quality-chooser",{attrs:{"overall-quality":e.defaultConfig.quality},on:{"update:quality:allowed":function(t){e.quality.allowed=t},"update:quality:preferred":function(t){e.quality.preferred=t}}})],1)])]),e._v(" "),e.subtitlesEnabled?n("div",{attrs:{id:"use-subtitles"}},[n("config-toggle-slider",{attrs:{label:"Subtitles",id:"subtitles",value:e.selectedSubtitleEnabled,explanations:["Download subtitles for this show?"]},on:{input:function(t){e.selectedSubtitleEnabled=t}}})],1):e._e(),e._v(" "),n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[e._m(1),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedStatus,expression:"selectedStatus"}],staticClass:"form-control form-control-inline input-sm",attrs:{id:"defaultStatus"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedStatus=t.target.multiple?n:n[0]}}},e._l(e.defaultEpisodeStatusOptions,function(t){return n("option",{key:t.value,domProps:{value:t.value}},[e._v(e._s(t.name))])}),0)])])]),e._v(" "),n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[e._m(2),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedStatusAfter,expression:"selectedStatusAfter"}],staticClass:"form-control form-control-inline input-sm",attrs:{id:"defaultStatusAfter"},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedStatusAfter=t.target.multiple?n:n[0]}}},e._l(e.defaultEpisodeStatusOptions,function(t){return n("option",{key:t.value,domProps:{value:t.value}},[e._v(e._s(t.name))])}),0)])])]),e._v(" "),n("config-toggle-slider",{attrs:{label:"Season Folders",id:"season_folders",value:e.selectedSeasonFoldersEnabled,disabled:e.namingForceFolders,explanations:["Group episodes by season folders?"]},on:{input:function(t){e.selectedSeasonFoldersEnabled=t}}}),e._v(" "),e.enableAnimeOptions?n("config-toggle-slider",{attrs:{label:"Anime",id:"anime",value:e.selectedAnimeEnabled,explanations:["Is this show an Anime?"]},on:{input:function(t){e.selectedAnimeEnabled=t}}}):e._e(),e._v(" "),e.enableAnimeOptions&&e.selectedAnimeEnabled?n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[e._m(3),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("anidb-release-group-ui",{staticClass:"max-width",attrs:{"show-name":e.showName},on:{change:e.onChangeReleaseGroupsAnime}})],1)])]):e._e(),e._v(" "),n("config-toggle-slider",{attrs:{label:"Scene Numbering",id:"scene",value:e.selectedSceneEnabled,explanations:["Is this show scene numbered?"]},on:{input:function(t){e.selectedSceneEnabled=t}}}),e._v(" "),n("div",{staticClass:"form-group"},[n("div",{staticClass:"row"},[e._m(4),e._v(" "),n("div",{staticClass:"col-sm-10 content"},[n("button",{staticClass:"btn-medusa btn-inline",attrs:{type:"button",disabled:e.saving||e.saveDefaultsDisabled},on:{click:function(t){return t.preventDefault(),e.saveDefaults(t)}}},[e._v("Save Defaults")])])])])],1)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"customQuality"}},[t("span",[this._v("Quality")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"defaultStatus"}},[t("span",[this._v("Status for previously aired episodes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"defaultStatusAfter"}},[t("span",[this._v("Status for all future episodes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"anidbReleaseGroup"}},[t("span",[this._v("Release Groups")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("label",{staticClass:"col-sm-2 control-label",attrs:{for:"saveDefaultsButton"}},[t("span",[this._v("Use current values as the defaults")])])}],!1,null,null,null).exports,x=(n(115),n(19));function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var S={name:"app-footer",components:{AppLink:g.a},computed:function(e){for(var t=1;t0&&(n=String(t)+(t>1?" days, ":" day, "));const s=new Date(e%864e5),a=(e,t=2)=>String(e).padStart(t,"0");return n+[String(s.getUTCHours()),a(s.getUTCMinutes()),a(s.getUTCSeconds()+Math.round(s.getUTCMilliseconds()/1e3))].join(":")}}},C=Object(w.a)(S,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("footer",[n("div",{staticClass:"footer clearfix"},[n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.stats.overall.shows.total))]),e._v(" Shows ("),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.stats.overall.shows.active))]),e._v(" Active)\n | "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.stats.overall.episodes.downloaded))]),e._v(" "),e.stats.overall.episodes.snatched?[n("span",{staticClass:"footerhighlight"},[n("app-link",{attrs:{href:"manage/episodeStatuses?whichStatus="+e.snatchedStatus,title:"View overview of snatched episodes"}},[e._v("+"+e._s(e.stats.overall.episodes.snatched))])],1),e._v("\n Snatched\n ")]:e._e(),e._v("\n / "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.stats.overall.episodes.total))]),e._v(" Episodes Downloaded "),e.episodePercentage?n("span",{staticClass:"footerhighlight"},[e._v("("+e._s(e.episodePercentage)+")")]):e._e(),e._v("\n | Daily Search: "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.schedulerNextRun("dailySearch")))]),e._v("\n | Backlog Search: "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.schedulerNextRun("backlog")))]),e._v(" "),n("div",[e.system.memoryUsage?[e._v("\n Memory used: "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.system.memoryUsage))]),e._v(" |\n ")]:e._e(),e._v(" "),e._v("\n Branch: "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.system.branch||"Unknown"))]),e._v(" |\n Now: "),n("span",{staticClass:"footerhighlight"},[e._v(e._s(e.nowInUserPreset))])],2)],2)])},[],!1,null,"a67a05c0",null).exports,O=n(50).a,P=(n(214),Object(w.a)(O,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{staticClass:"navbar navbar-default navbar-fixed-top hidden-print",attrs:{role:"navigation"}},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"navbar-header"},[n("button",{staticClass:"navbar-toggle collapsed",attrs:{type:"button","data-toggle":"collapse","data-target":"#main_nav"}},[e.toolsBadgeCount>0?n("span",{class:"floating-badge"+e.toolsBadgeClass},[e._v(e._s(e.toolsBadgeCount))]):e._e(),e._v(" "),n("span",{staticClass:"sr-only"},[e._v("Toggle navigation")]),e._v(" "),n("span",{staticClass:"icon-bar"}),e._v(" "),n("span",{staticClass:"icon-bar"}),e._v(" "),n("span",{staticClass:"icon-bar"})]),e._v(" "),n("app-link",{staticClass:"navbar-brand",attrs:{href:"home/",title:"Medusa"}},[n("img",{staticClass:"img-responsive pull-left",staticStyle:{height:"50px"},attrs:{alt:"Medusa",src:"images/medusa.png"}})])],1),e._v(" "),e.isAuthenticated?n("div",{staticClass:"collapse navbar-collapse",attrs:{id:"main_nav"}},[n("ul",{staticClass:"nav navbar-nav navbar-right"},[n("li",{staticClass:"navbar-split dropdown",class:{active:"home"===e.topMenu},attrs:{id:"NAVhome"}},[n("app-link",{staticClass:"dropdown-toggle",attrs:{href:"home/","aria-haspopup":"true","data-toggle":"dropdown","data-hover":"dropdown"}},[n("span",[e._v("Shows")]),e._v(" "),n("b",{staticClass:"caret"})]),e._v(" "),n("ul",{staticClass:"dropdown-menu"},[n("li",[n("app-link",{attrs:{href:"home/"}},[n("i",{staticClass:"menu-icon-home"}),e._v(" Show List")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"addShows/"}},[n("i",{staticClass:"menu-icon-addshow"}),e._v(" Add Shows")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"addRecommended/"}},[n("i",{staticClass:"menu-icon-addshow"}),e._v(" Add Recommended Shows")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"home/postprocess/"}},[n("i",{staticClass:"menu-icon-postprocess"}),e._v(" Manual Post-Processing")])],1),e._v(" "),e.recentShows.length>0?n("li",{staticClass:"divider",attrs:{role:"separator"}}):e._e(),e._v(" "),e._l(e.recentShows,function(t){return n("li",{key:t.link},[n("app-link",{attrs:{href:t.link}},[n("i",{staticClass:"menu-icon-addshow"}),e._v(" "+e._s(t.name)+"\n ")])],1)})],2),e._v(" "),n("div",{staticStyle:{clear:"both"}})],1),e._v(" "),n("li",{class:{active:"schedule"===e.topMenu},attrs:{id:"NAVschedule"}},[n("app-link",{attrs:{href:"schedule/"}},[e._v("Schedule")])],1),e._v(" "),n("li",{class:{active:"history"===e.topMenu},attrs:{id:"NAVhistory"}},[n("app-link",{attrs:{href:"history/"}},[e._v("History")])],1),e._v(" "),n("li",{staticClass:"navbar-split dropdown",class:{active:"manage"===e.topMenu},attrs:{id:"NAVmanage"}},[n("app-link",{staticClass:"dropdown-toggle",attrs:{href:"manage/episodeStatuses/","aria-haspopup":"true","data-toggle":"dropdown","data-hover":"dropdown"}},[n("span",[e._v("Manage")]),e._v(" "),n("b",{staticClass:"caret"})]),e._v(" "),n("ul",{staticClass:"dropdown-menu"},[n("li",[n("app-link",{attrs:{href:"manage/"}},[n("i",{staticClass:"menu-icon-manage"}),e._v(" Mass Update")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"manage/backlogOverview/"}},[n("i",{staticClass:"menu-icon-backlog-view"}),e._v(" Backlog Overview")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"manage/manageSearches/"}},[n("i",{staticClass:"menu-icon-manage-searches"}),e._v(" Manage Searches")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"manage/episodeStatuses/"}},[n("i",{staticClass:"menu-icon-manage2"}),e._v(" Episode Status Management")])],1),e._v(" "),e.linkVisible.plex?n("li",[n("app-link",{attrs:{href:"home/updatePLEX/"}},[n("i",{staticClass:"menu-icon-plex"}),e._v(" Update PLEX")])],1):e._e(),e._v(" "),e.linkVisible.kodi?n("li",[n("app-link",{attrs:{href:"home/updateKODI/"}},[n("i",{staticClass:"menu-icon-kodi"}),e._v(" Update KODI")])],1):e._e(),e._v(" "),e.linkVisible.emby?n("li",[n("app-link",{attrs:{href:"home/updateEMBY/"}},[n("i",{staticClass:"menu-icon-emby"}),e._v(" Update Emby")])],1):e._e(),e._v(" "),e.linkVisible.manageTorrents?n("li",[n("app-link",{attrs:{href:"manage/manageTorrents/",target:"_blank"}},[n("i",{staticClass:"menu-icon-bittorrent"}),e._v(" Manage Torrents")])],1):e._e(),e._v(" "),e.linkVisible.failedDownloads?n("li",[n("app-link",{attrs:{href:"manage/failedDownloads/"}},[n("i",{staticClass:"menu-icon-failed-download"}),e._v(" Failed Downloads")])],1):e._e(),e._v(" "),e.linkVisible.subtitleMissed?n("li",[n("app-link",{attrs:{href:"manage/subtitleMissed/"}},[n("i",{staticClass:"menu-icon-backlog"}),e._v(" Missed Subtitle Management")])],1):e._e(),e._v(" "),e.linkVisible.subtitleMissedPP?n("li",[n("app-link",{attrs:{href:"manage/subtitleMissedPP/"}},[n("i",{staticClass:"menu-icon-backlog"}),e._v(" Missed Subtitle in Post-Process folder")])],1):e._e()]),e._v(" "),n("div",{staticStyle:{clear:"both"}})],1),e._v(" "),n("li",{staticClass:"navbar-split dropdown",class:{active:"config"===e.topMenu},attrs:{id:"NAVconfig"}},[n("app-link",{staticClass:"dropdown-toggle",attrs:{href:"config/","aria-haspopup":"true","data-toggle":"dropdown","data-hover":"dropdown"}},[n("span",{staticClass:"visible-xs-inline"},[e._v("Config")]),n("img",{staticClass:"navbaricon hidden-xs",attrs:{src:"images/menu/system18.png"}}),e._v(" "),n("b",{staticClass:"caret"})]),e._v(" "),n("ul",{staticClass:"dropdown-menu"},[n("li",[n("app-link",{attrs:{href:"config/"}},[n("i",{staticClass:"menu-icon-help"}),e._v(" Help & Info")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/general/"}},[n("i",{staticClass:"menu-icon-config"}),e._v(" General")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/backuprestore/"}},[n("i",{staticClass:"menu-icon-backup"}),e._v(" Backup & Restore")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/search/"}},[n("i",{staticClass:"menu-icon-manage-searches"}),e._v(" Search Settings")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/providers/"}},[n("i",{staticClass:"menu-icon-provider"}),e._v(" Search Providers")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/subtitles/"}},[n("i",{staticClass:"menu-icon-backlog"}),e._v(" Subtitles Settings")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/postProcessing/"}},[n("i",{staticClass:"menu-icon-postprocess"}),e._v(" Post Processing")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/notifications/"}},[n("i",{staticClass:"menu-icon-notification"}),e._v(" Notifications")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"config/anime/"}},[n("i",{staticClass:"menu-icon-anime"}),e._v(" Anime")])],1)]),e._v(" "),n("div",{staticStyle:{clear:"both"}})],1),e._v(" "),n("li",{staticClass:"navbar-split dropdown",class:{active:"system"===e.topMenu},attrs:{id:"NAVsystem"}},[n("app-link",{staticClass:"padding-right-15 dropdown-toggle",attrs:{href:"home/status/","aria-haspopup":"true","data-toggle":"dropdown","data-hover":"dropdown"}},[n("span",{staticClass:"visible-xs-inline"},[e._v("Tools")]),n("img",{staticClass:"navbaricon hidden-xs",attrs:{src:"images/menu/system18-2.png"}}),e._v(" "),e.toolsBadgeCount>0?n("span",{class:"badge"+e.toolsBadgeClass},[e._v(e._s(e.toolsBadgeCount))]):e._e(),e._v(" "),n("b",{staticClass:"caret"})]),e._v(" "),n("ul",{staticClass:"dropdown-menu"},[n("li",[n("app-link",{attrs:{href:"news/"}},[n("i",{staticClass:"menu-icon-news"}),e._v(" News "),e.system.news.unread>0?n("span",{staticClass:"badge"},[e._v(e._s(e.system.news.unread))]):e._e()])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"IRC/"}},[n("i",{staticClass:"menu-icon-irc"}),e._v(" IRC")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"changes/"}},[n("i",{staticClass:"menu-icon-changelog"}),e._v(" Changelog")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:e.config.donationsUrl}},[n("i",{staticClass:"menu-icon-support"}),e._v(" Support Medusa")])],1),e._v(" "),n("li",{staticClass:"divider",attrs:{role:"separator"}}),e._v(" "),e.config.logs.numErrors>0?n("li",[n("app-link",{attrs:{href:"errorlogs/"}},[n("i",{staticClass:"menu-icon-error"}),e._v(" View Errors "),n("span",{staticClass:"badge btn-danger"},[e._v(e._s(e.config.logs.numErrors))])])],1):e._e(),e._v(" "),e.config.logs.numWarnings>0?n("li",[n("app-link",{attrs:{href:"errorlogs/?level="+e.warningLevel}},[n("i",{staticClass:"menu-icon-viewlog-errors"}),e._v(" View Warnings "),n("span",{staticClass:"badge btn-warning"},[e._v(e._s(e.config.logs.numWarnings))])])],1):e._e(),e._v(" "),n("li",[n("app-link",{attrs:{href:"errorlogs/viewlog/"}},[n("i",{staticClass:"menu-icon-viewlog"}),e._v(" View Log")])],1),e._v(" "),n("li",{staticClass:"divider",attrs:{role:"separator"}}),e._v(" "),n("li",[n("app-link",{attrs:{href:"home/updateCheck?pid="+e.system.pid}},[n("i",{staticClass:"menu-icon-update"}),e._v(" Check For Updates")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"home/restart/?pid="+e.system.pid},nativeOn:{click:function(t){return t.preventDefault(),e.confirmDialog(t,"restart")}}},[n("i",{staticClass:"menu-icon-restart"}),e._v(" Restart")])],1),e._v(" "),n("li",[n("app-link",{attrs:{href:"home/shutdown/?pid="+e.system.pid},nativeOn:{click:function(t){return t.preventDefault(),e.confirmDialog(t,"shutdown")}}},[n("i",{staticClass:"menu-icon-shutdown"}),e._v(" Shutdown")])],1),e._v(" "),e.username?n("li",[n("app-link",{attrs:{href:"logout"},nativeOn:{click:function(t){return t.preventDefault(),e.confirmDialog(t,"logout")}}},[n("i",{staticClass:"menu-icon-shutdown"}),e._v(" Logout")])],1):e._e(),e._v(" "),n("li",{staticClass:"divider",attrs:{role:"separator"}}),e._v(" "),n("li",[n("app-link",{attrs:{href:"home/status/"}},[n("i",{staticClass:"menu-icon-info"}),e._v(" Server Status")])],1)]),e._v(" "),n("div",{staticStyle:{clear:"both"}})],1)])]):e._e()])])},[],!1,null,null,null).exports),E=n(21),D=(n(113),n(122),n(120),n(123),n(118),n(121),n(119),n(67).a),T=Object(w.a)(D,void 0,void 0,!1,null,null,null).exports,N=n(68).a,A=Object(w.a)(N,void 0,void 0,!1,null,null,null).exports,$=(n(111),n(116),n(117),n(71).a),j=Object(w.a)($,void 0,void 0,!1,null,null,null).exports,M=n(80),L=n(72).a,I=Object(w.a)(L,void 0,void 0,!1,null,null,null).exports,B=(n(27),n(73).a),z=(n(248),Object(w.a)(B,void 0,void 0,!1,null,null,null).exports),R=n(75).a,F=Object(w.a)(R,void 0,void 0,!1,null,null,null).exports,q=n(76).a,U=(n(250),Object(w.a)(q,function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.subMenu.length>0?n("div",{attrs:{id:"sub-menu-wrapper"}},[n("div",{staticClass:"row shadow",attrs:{id:"sub-menu-container"}},[n("div",{staticClass:"submenu-default hidden-print col-md-12",attrs:{id:"sub-menu"}},[e._l(e.subMenu,function(t){return n("app-link",{key:"sub-menu-"+t.title,staticClass:"btn-medusa top-5 bottom-5",attrs:{href:t.path},nativeOn:e._d({},[e.clickEventCond(t),function(n){return n.preventDefault(),e.confirmDialog(n,t.confirm)}])},[n("span",{class:["pull-left",t.icon]}),e._v(" "+e._s(t.title)+"\n ")])}),e._v(" "),e.showSelectorVisible?n("show-selector",{attrs:{"show-slug":e.curShowSlug,"follow-selection":""}}):e._e()],2)]),e._v(" "),n("div",{staticClass:"btn-group"})]):e._e()},[],!1,null,"0918603e",null).exports),Q=(n(78),n(112),n(22));n.d(t,"b",function(){return H}),n.d(t,"c",function(){return V});const H=()=>{let{components:e=[]}=window;(e=(e=(e=e.concat([C,P,g.m,U])).concat([y,v.a,g.a,g.b,E.a,g.c,g.d,g.e,g.f,g.g,g.h,g.j,g.k,g.l,M.a,g.n,g.o,g.p])).concat([T,A,j,I,z,F])).forEach(e=>{m.f&&console.debug("Registering ".concat(e.name)),s.a.component(e.name,e)})},V=()=>{s.a.use(a.a),s.a.use(o.a),s.a.use(i.a),s.a.use(l.a),s.a.use(d.a),s.a.use(u.b),l.a.config("10y")};t.a=()=>{const e=(e,t)=>"".concat(e," is using the global Vuex '").concat(t,"' state, ")+"please replace that with a local one using: mapState(['".concat(t,"'])");s.a.mixin({data(){return this.$root===this?{globalLoading:!0,pageComponent:!1}:{}},mounted(){if(this.$root===this&&!window.location.pathname.includes("/login")){const{username:e}=window;Promise.all([Q.a.dispatch("login",{username:e}),Q.a.dispatch("getConfig"),Q.a.dispatch("getStats")]).then(([e,t])=>{this.$emit("loaded");const n=new CustomEvent("medusa-config-loaded",{detail:t.main});window.dispatchEvent(n)}).catch(e=>{console.debug(e),alert("Unable to connect to Medusa!")})}this.$once("loaded",()=>{this.$root.globalLoading=!1})},computed:{auth(){return m.f&&!this.__VUE_DEVTOOLS_UID__&&console.warn(e(this._name,"auth")),this.$store.state.auth},config(){return m.f&&!this.__VUE_DEVTOOLS_UID__&&console.warn(e(this._name,"config")),this.$store.state.config}}}),m.f&&console.debug("Loading local Vue"),V(),H()}},function(e,t,n){var s=n(191);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("53f5e432",s,!1,{})},function(e,t,n){var s=n(193);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("8d1653e8",s,!1,{})},function(e,t,n){var s=n(195);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("3ca8845c",s,!1,{})},function(e,t,n){var s=n(197);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("1bcb1e12",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(3);t.a={name:"file-browser",props:{name:{type:String,default:"proc_dir"},title:{type:String,default:"Choose Directory"},includeFiles:{type:Boolean,default:!1},showBrowseButton:{type:Boolean,default:!0},autocomplete:{type:Boolean,default:!1},localStorageKey:{type:String,default:""},initialDir:{type:String,default:""}},data(){return{lock:!1,unwatchProp:null,files:[],currentPath:this.initialDir,lastPath:"",url:"browser/",autocompleteUrl:"browser/complete",fileBrowserDialog:null,localStorageSupport:(()=>{try{return Boolean(localStorage.getItem),!0}catch(e){return console.log(e),!1}})()}},created(){this.unwatchProp=this.$watch("initialDir",e=>{this.unwatchProp(),this.lock=!0,this.currentPath=e,this.$nextTick(()=>{this.lock=!1})})},mounted(){const{autocomplete:e,fileBrowser:t,storedPath:n,$refs:s}=this;t(s.locationInput,e).on("autocompleteselect",(e,t)=>{this.currentPath=t.item.value}),!this.currentPath&&n&&(this.currentPath=n)},computed:{storedPath:{get(){const{localStorageSupport:e,localStorageKey:t}=this;return e&&t?localStorage["fileBrowser-"+t]:null},set(e){const{localStorageSupport:t,localStorageKey:n}=this;t&&n&&(localStorage["fileBrowser-"+n]=e)}}},methods:{toggleFolder(e,t){if(e.isFile)return;const n=t.target.children[0]||t.target;n.classList.toggle("ui-icon-folder-open"),n.classList.toggle("ui-icon-folder-collapsed")},fileClicked(t){t.isFile?(this.currentPath=t.path,e(this.$el).find('.browserDialog .ui-button:contains("Ok")').click()):this.browse(t.path)},browse(t){const{url:n,includeFiles:a,fileBrowserDialog:o}=this;e(this.$refs.fileBrowserSearchBox).autocomplete("close"),console.debug("Browsing to "+t),o.dialog("option","dialogClass","browserDialog busy"),o.dialog("option","closeText","");const i={path:t,includeFiles:Number(a)};s.c.get(n,{params:i}).then(e=>{const{data:t}=e;this.currentPath=t.shift().currentPath,this.files=t,o.dialog("option","dialogClass","browserDialog")}).catch(e=>{console.warning("Unable to browse to: ".concat(t,"\nError: ").concat(e.message),e)})},openFileBrowser(t){const n=this,{browse:s,title:a,fileBrowser:o,$refs:i}=n,{fileBrowserSearchBox:r,fileBrowserFileList:l}=i;n.fileBrowserDialog||(n.fileBrowserDialog=e(i.fileBrowserDialog).dialog({dialogClass:"browserDialog",title:a,position:{my:"center top",at:"center top+100",of:window},minWidth:Math.min(e(document).width()-80,650),height:Math.min(e(document).height()-120,e(window).height()-120),maxHeight:Math.min(e(document).height()-120,e(window).height()-120),maxWidth:e(document).width()-80,modal:!0,autoOpen:!1}),r.removeAttribute("style"),n.fileBrowserDialog.append(r),o(r,!0).on("autocompleteselect",(e,t)=>{s(t.item.value)})),n.fileBrowserDialog.dialog("option","buttons",[{text:"Ok",class:"medusa-btn",click(){t(n.currentPath),e(this).dialog("close")}},{text:"Cancel",class:"medusa-btn",click(){n.currentPath=n.lastPath,e(this).dialog("close")}}]),n.fileBrowserDialog.dialog("open"),s(n.currentPath),n.lastPath=n.currentPath,l.removeAttribute("style"),n.fileBrowserDialog.append(l)},fileBrowser(t,n){const s=this,{autocompleteUrl:a,includeFiles:o}=s,i=e(t);if(n&&i.autocomplete&&a){let t="";i.autocomplete({position:{my:"top",at:"bottom",collision:"flipfit"},source(n,s){t=e.ui.autocomplete.escapeRegex(n.term),n.includeFiles=Number(o),e.ajax({url:a,data:n,dataType:"json"}).done(n=>{const a=new RegExp("^"+t,"i"),o=e.grep(n,e=>a.test(e));s(o)})},open(){e(s.$el).find(".ui-autocomplete li.ui-menu-item a").removeClass("ui-corner-all")}}).data("ui-autocomplete")._renderItem=(n,s)=>{let a=s.label;const o=new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t+")(?![^<>]*>)(?![^&;]+;)","gi");return a=a.replace(o,e=>""+e+""),e("
  • ").data("ui-autocomplete-item",s).append(''+a+"").appendTo(n)}}return i},openDialog(){const{openFileBrowser:e,currentPath:t}=this;e(e=>{this.storedPath=e||t})}},watch:{currentPath(){this.lock||this.$emit("update",this.currentPath)}}}}).call(this,n(5))},function(e,t,n){var s=n(199);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("c8a1d516",s,!1,{})},function(e,t,n){"use strict";(function(e){t.a={name:"language-select",props:{language:{type:String,default:"en"},available:{type:String,default:"en"},blank:{type:Boolean,default:!1},flags:{type:Boolean,default:!1}},mounted(){const t=this;e(this.$el).bfhlanguages({flags:this.flags,language:this.language,available:this.available,blank:this.blank}),e(this.$el).on("change",e=>{t.$emit("update-language",e.currentTarget.value)})},watch:{language(){e(this.$el).val(this.language)}}}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(19),a=n(17),o=n(3);t.a={name:"name-pattern",components:{ToggleButton:a.ToggleButton},props:{namingPattern:{type:String,default:""},namingPresets:{type:Array,default:()=>[]},multiEpStyle:{type:Number},multiEpStyles:{type:Array,default:()=>[]},animeNamingType:{type:Number,default:0},type:{type:String,default:""},enabled:{type:Boolean,default:!0},flagLoaded:{type:Boolean,default:!1}},data:()=>({presets:[],availableMultiEpStyles:[],pattern:"",customName:"",showLegend:!1,namingExample:"",namingExampleMulti:"",isEnabled:!1,selectedMultiEpStyle:1,animeType:0,lastSelectedPattern:""}),methods:{getDateFormat:e=>Object(s.a)(new Date,e),testNaming(e,t,n){console.debug("Test pattern ".concat(e," for ").concat(t?"multi":"single ep"));const s={pattern:e,anime_type:n};t&&(s.multi=t);try{return o.c.get("config/postProcessing/testNaming",{params:s,timeout:2e4}).then(e=>e.data)}catch(e){return console.warn(e),""}},updatePatternSamples(){this.customName||(this.customName=this.lastSelectedPattern);const e=this.isCustom?this.customName:this.pattern;e&&null!==this.animeType&&null!==this.selectedMultiEpStyle&&(this.testNaming(e,!1,this.animeType).then(e=>{this.namingExample=e+".ext"}),this.checkNaming(e,!1,this.animeType),this.isMulti&&(this.testNaming(e,this.selectedMultiEpStyle,this.animeType).then(e=>{this.namingExampleMulti=e+".ext"}),this.checkNaming(e,this.selectedMultiEpStyle,this.animeType)))},update(){this.flagLoaded&&this.$nextTick(()=>{this.$emit("change",{pattern:this.isCustom?this.customName:this.pattern,type:this.type,multiEpStyle:this.selectedMultiEpStyle,custom:this.isCustom,enabled:this.isEnabled,animeNamingType:Number(this.animeType)})})},checkNaming(t,n,s){if(!t)return;const a={pattern:t,anime_type:s};n&&(a.multi=n);const{$el:i}=this,r=e(i);o.c.get("config/postProcessing/isNamingValid",{params:a,timeout:2e4}).then(e=>{"invalid"===e.data?(r.find("#naming_pattern").qtip("option",{"content.text":"This pattern is invalid.","style.classes":"qtip-rounded qtip-shadow qtip-red"}),r.find("#naming_pattern").qtip("toggle",!0),r.find("#naming_pattern").css("background-color","#FFDDDD")):"seasonfolders"===e.data?(r.find("#naming_pattern").qtip("option",{"content.text":'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',"style.classes":"qtip-rounded qtip-shadow qtip-red"}),r.find("#naming_pattern").qtip("toggle",!0),r.find("#naming_pattern").css("background-color","#FFFFDD")):(r.find("#naming_pattern").qtip("option",{"content.text":"This pattern is valid.","style.classes":"qtip-rounded qtip-shadow qtip-green"}),r.find("#naming_pattern").qtip("toggle",!1),r.find("#naming_pattern").css("background-color","#FFFFFF"))}).catch(e=>{console.warn(e)})},updateCustomName(){this.presetsPatterns.includes(this.pattern)||(this.customName=this.pattern),this.customName||(this.customName=this.lastSelectedPattern)}},computed:{isCustom(){return!!this.pattern&&(!this.presetsPatterns.includes(this.pattern)||"Custom..."===this.pattern)},selectedNamingPattern:{get(){return this.isCustom?"Custom...":(()=>{const e=this.presets.filter(e=>e.pattern===this.pattern);return e.length>0&&e[0].example})()},set(e){this.pattern=this.presets.filter(t=>t.example===e)[0].pattern}},presetsPatterns(){return this.presets.map(e=>e.pattern)},isMulti(){return Boolean(this.multiEpStyle)}},mounted(){this.pattern=this.namingPattern,this.presets=this.namingPresets.concat({pattern:"Custom...",example:"Custom..."}),this.updateCustomName(),this.availableMultiEpStyles=this.multiEpStyles,this.selectedMultiEpStyle=this.multiEpStyle,this.animeType=this.animeNamingType,this.isEnabled=!this.type&&this.enabled,this.updatePatternSamples()},watch:{enabled(){this.isEnabled=this.enabled},namingPattern(e,t){this.lastSelectedPattern=e||t,this.pattern=this.namingPattern,this.updateCustomName(),this.updatePatternSamples()},namingPresets(){this.presets=this.namingPresets},multiEpStyle(){this.selectedMultiEpStyle=this.multiEpStyle,this.updatePatternSamples()},multiEpStyles(){this.availableMultiEpStyles=this.multiEpStyles},animeNamingType(){this.animeType=this.animeNamingType,this.updatePatternSamples()},type(){this.isEnabled=!this.type&&this.enabled}}}}).call(this,n(5))},function(e,t,n){var s=n(201);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("3cd47313",s,!1,{})},function(e,t,n){var s=n(203);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("357562c6",s,!1,{})},function(e,t,n){var s=n(205);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("0d4dcec1",s,!1,{})},function(e,t,n){"use strict";(function(e){t.a={name:"scroll-buttons",data:()=>({showToTop:!1,showLeftRight:!1}),methods:{scrollTop(){const{scrollTo:t}=this;t(e("body"))},scrollLeft(){e("div.horizontal-scroll").animate({scrollLeft:"-=153"},1e3,"easeOutQuad")},scrollRight(){e("div.horizontal-scroll").animate({scrollLeft:"+=153"},1e3,"easeOutQuad")},scrollTo(t){e("html, body").animate({scrollTop:e(t).offset().top},500,"linear")},initHorizontalScroll(){const t=e("div.horizontal-scroll").get();if(0===t.length)return;const n=t.map(e=>e.scrollWidth>e.clientWidth).indexOf(!0);this.showLeftRight=n>=0}},mounted(){const{initHorizontalScroll:t}=this;t(),e(window).on("resize",()=>{t()}),e(document).on("scroll",()=>{e(window).scrollTop()>100?this.showToTop=!0:this.showToTop=!1})}}}).call(this,n(5))},function(e,t,n){var s=n(207);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("0faefb92",s,!1,{})},function(e,t,n){var s=n(209);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("3fbe8aec",s,!1,{})},function(e,t,n){var s=n(211);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("ea8d60b8",s,!1,{})},function(e,t,n){var s=n(213);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("13510eb0",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1),i=n(2);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}t.a={name:"app-header",components:{AppLink:i.a},computed:function(e){for(var t=1;te.auth.isAuthenticated,username:e=>e.auth.user.username,warningLevel:e=>e.config.logs.loggingLevels.warning}),{recentShows(){const{config:e}=this,{recentShows:t}=e;return t.map(e=>{const{name:t,indexerName:n,showId:s}=e;return{name:t,link:"home/displayShow?indexername=".concat(n,"&seriesid=").concat(s)}})},topMenu(){return this.$route.meta.topMenu},toolsBadgeCount(){const{config:e}=this,{system:t}=this,{logs:n}=e,{news:s}=t;return n.numErrors+n.numWarnings+s.unread},toolsBadgeClass(){const{config:e}=this,{logs:t}=e;return t.numErrors>0?" btn-danger":t.numWarnings>0?" btn-warning":""},linkVisible(){const{clients:e,config:t,notifiers:n,postprocessing:s,search:a}=this,{subtitles:o}=t,{general:i}=a,{kodi:r,plex:l,emby:c}=n;return{plex:l.server.enabled&&0!==l.server.host.length,kodi:r.enabled&&0!==r.host.length,emby:c.enabled&&c.host,manageTorrents:e.torrents.enabled&&"blackhole"!==e.torrents.method,failedDownloads:i.failedDownloads.enabled,subtitleMissed:o.enabled,subtitleMissedPP:s.postponeIfNoSubs}}}),mounted(){const{$el:t}=this;t.clickCloseMenus=t=>{const{target:n}=t;if(n.matches("#main_nav a.router-link, #main_nav a.router-link *")){const t=n.closest(".dropdown");t.querySelector(".dropdown-toggle").setAttribute("aria-expanded",!1),t.querySelector(".dropdown-menu").style.display="none",e("#main_nav").collapse("hide")}},t.addEventListener("click",t.clickCloseMenus,{passive:!0}),e(t).on({mouseenter(t){const n=e(t.currentTarget);n.find(".dropdown-menu").stop(!0,!0).delay(200).fadeIn(500,()=>{n.find(".dropdown-toggle").attr("aria-expanded","true")})},mouseleave(t){const n=e(t.currentTarget);n.find(".dropdown-toggle").attr("aria-expanded","false"),n.find(".dropdown-menu").stop(!0,!0).delay(200).fadeOut(500)}},"ul.nav li.dropdown"),(navigator.maxTouchPoints||0)<2&&e(t).on("click",".dropdown-toggle",t=>{const n=e(t.currentTarget);"true"===n.attr("aria-expanded")&&(window.location.href=n.attr("href"))})},destroyed(){const{$el:t}=this;t.removeEventListener("click",t.clickCloseMenus),e(t).off("mouseenter mouseleave","ul.nav li.dropdown"),(navigator.maxTouchPoints||0)<2&&e(t).off("click",".dropdown-toggle")},methods:{confirmDialog(t,n){const s={confirmButton:"Yes",cancelButton:"Cancel",dialogClass:"modal-dialog",post:!1,button:e(t.currentTarget),confirm(e){window.location.href=e[0].href}};if("restart"===n)s.title="Restart",s.text="Are you sure you want to restart Medusa?";else if("shutdown"===n)s.title="Shutdown",s.text="Are you sure you want to shutdown Medusa?";else{if("logout"!==n)return;s.title="Logout",s.text="Are you sure you want to logout from Medusa?"}e.confirm(s,t)}}}}).call(this,n(5))},function(e,t,n){var s=n(215);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("ef1315ea",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1),i=n(3),r=n(6);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}t.a={name:"backstretch",render:e=>e(),props:{slug:String},data:()=>({created:!1}),computed:function(e){for(var t=1;te.layout.fanartBackground,opacity:e=>e.layout.fanartBackgroundOpacity}),{offset(){let t="90px";return 0===e("#sub-menu-container").length&&(t="50px"),e(window).width()<1280&&(t="50px"),t}}),async mounted(){try{await Object(r.g)(()=>null!==this.enabled)}catch(e){}if(!this.enabled)return;const{opacity:t,slug:n,offset:s}=this;if(n){const a="".concat(i.e,"/api/v2/series/").concat(n,"/asset/fanart?api_key=").concat(i.b),{$wrap:o}=e.backstretch(a);o.css("top",s),o.css("opacity",t).fadeIn(500),this.created=!0}},destroyed(){this.created&&e.backstretch("destroy")},watch:{opacity(t){if(this.created){const{$wrap:n}=e("body").data("backstretch");n.css("opacity",t).fadeIn(500)}}}}}).call(this,n(5))},function(e,t,n){var s=n(217);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("680016fc",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(30),a=n.n(s),o=n(4),i=n.n(o),r=n(3),l=n(1),c=n(80),d=n(2),u=n(6),p=n(19),h=n(17),f=n(131),m=n.n(f),g=(n(221),n(23));function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function b(e){for(var t=1;t({defaultPageOptions:[{value:"home",text:"Shows"},{value:"schedule",text:"Schedule"},{value:"history",text:"History"},{value:"news",text:"News"},{value:"IRC",text:"IRC"}],privacyLevelOptions:[{value:"high",text:"HIGH"},{value:"normal",text:"NORMAL"},{value:"low",text:"LOW"}],githubBranchesForced:[],resetBranchSelected:null}),beforeMount(){this.$nextTick(()=>{e("#config-components").tabs()})},computed:b({},Object(l.e)({config:e=>e.config,configLoaded:e=>e.consts.statuses.length>0,layout:e=>e.layout,statuses:e=>e.consts.statuses,indexers:e=>e.indexers,system:e=>e.system}),{},Object(l.d)(["getStatus"]),{indexerDefault(){const{config:e}=this,{indexerDefault:t}=e;return t||0},indexerListOptions(){const{indexers:e}=this;return[{text:"All Indexers",value:0},...Object.values(e.indexers).map(e=>({value:e.id,text:e.name}))]},datePresetOptions(){const{config:e}=this,{datePresets:t}=e;return[{value:"%x",text:"Use System Default"},...t.map(e=>({value:e,text:Object(p.a)(new Date,Object(u.d)(e))}))]},timePresetOptions(){const{config:e}=this,{timePresets:t}=e;return[{value:"%x",text:"Use System Default"},...t.map(e=>({value:e,text:Object(p.a)(new Date,Object(u.d)(e))}))]},availableThemesOptions(){const{config:e}=this,{availableThemes:t}=e;return t?t.map(e=>({value:e.name,text:"".concat(e.name," (").concat(e.version,")")})):[]},cpuPresetOptions(){const{system:e}=this,{cpuPresets:t}=e;return t?Object.keys(t).map(e=>({value:e,text:e})):[]},defaultDeletedEpOptions(){const{config:e,getStatus:t}=this;let n=[];return(n=e.skipRemovedFiles?["skipped","ignored"].map(e=>t({key:e})):["skipped","ignored","archived"].map(e=>t({key:e}))).every(e=>void 0!==e)?n.map(e=>({text:e.name,value:e.value})):[]},githubRemoteBranchesOptions(){const{config:e,githubBranches:t,githubBranchForceUpdate:n}=this,{system:s}=this,{username:a,password:o,token:i}=e.git;if(!s.gitRemoteBranches)return[];!s.gitRemoteBranches.length>0&&n();let r=[];return(r=(a&&o||i)&&e.developer?t:a&&o||i?t.filter(e=>["master","develop"].includes(e)):t.filter(e=>["master"].includes(e))).map(e=>({text:e,value:e}))},githubBranches(){const{system:e,githubBranchesForced:t}=this;return e.gitRemoteBranches||t},githubTokenPopover(){const{config:e}=this;return"

    Copy the generated token and paste it in the token input box.

    "+'

    ')+'


    '}}),methods:b({},Object(l.c)(["setConfig","setTheme","getApiKey"]),{async githubBranchForceUpdate(){const e=await Object(r.c)("home/branchForceUpdate");e.data._size>0&&(this.githubBranchesForced=e.data.resetBranches)},async generateApiKey(){const{getApiKey:e,save:t}=this;try{await e(),this.$snotify.success("Saving and reloading the page, to utilize the new api key","Warning",{timeout:5e3}),setTimeout(()=>{t()},500),setTimeout(()=>{location.reload()},500)}catch(e){this.$snotify.error("Error while trying to get a new api key","Error")}},async changeTheme(e){const{setTheme:t}=this;try{await t({themeName:e}),this.$snotify.success("Saving and reloading the page","Saving",{timeout:5e3}),setTimeout(()=>{location.reload()},1e3)}catch(e){this.$snotify.error("Error while trying to change the theme","Error")}},async save(){const{config:e,layout:t,setConfig:n}=this;this.saving=!0;const{availableThemes:s,backlogOverview:o,datePresets:i,loggingLevels:r,logs:l,timePresets:c,randomShowSlug:d,recentShows:u,themeName:p}=e,h=a()(e,["availableThemes","backlogOverview","datePresets","loggingLevels","logs","timePresets","randomShowSlug","recentShows","themeName"]),f={section:"main",config:Object.assign({},h,{layout:t},{logs:{debug:e.logs.debug,dbDebug:e.logs.dbDebug,actualLogDir:e.logs.actualLogDir,nr:e.logs.nr,size:e.logs.size,subliminalLog:e.logs.subliminalLog,privacyLevel:e.logs.privacyLevel}})};try{await n(f),this.$snotify.success("Saved general config","Saved",{timeout:5e3})}catch(e){this.$snotify.error("Error while trying to save general config","Error")}finally{this.saving=!1}}})}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}t.a={name:"root-dirs",inheritAttrs:!1,data:()=>({rootDirs:[]}),beforeMount(){const{rawRootDirs:e,transformRaw:t}=this;this.rootDirs=t(e)},computed:function(e){for(var t=1;te.config.rootDirs}),{paths(){return this.rootDirs.map(e=>e.path)},selectedRootDir:{get(){const{rootDirs:e}=this,t=e.find(e=>e.selected);return t&&0!==e.length?t.path:null},set(e){const{rootDirs:t}=this;this.rootDirs=t.map(t=>(t.selected=t.path===e,t))}},defaultRootDir:{get(){const{rootDirs:e}=this,t=e.find(e=>e.default);return t&&0!==e.length?t.path:null},set(e){const{rootDirs:t}=this;this.rootDirs=t.map(t=>(t.default=t.path===e,t))}}}),filters:{markDefault:e=>e.default?"* ".concat(e.path):e.path},methods:{transformRaw(e){if(e.length<2)return[];const t=parseInt(e[0],10);return e.slice(1).map((e,n)=>({path:e,default:n===t,selected:n===t}))},add(){const{$el:t,rootDirs:n,selectedRootDir:s,defaultRootDir:a,saveRootDirs:o}=this;e(t).nFileBrowser(e=>{if(0===e.length)return;const t=n.find(t=>t.path===e);if(t&&t.path!==s)return void(this.selectedRootDir=e);const i=null===a;n.push({path:e,default:i,selected:i}),o()})},edit(){const{$el:t,rootDirs:n,selectedRootDir:s,saveRootDirs:a}=this;e(t).nFileBrowser(e=>{if(0===e.length)return;const t=n.find(t=>t.path===e);if(t&&t.path!==s){const a=t.default;this.rootDirs=n.reduce((t,n)=>{if(n.path===s)return t;const o=n.path===e;return n.selected=o,n.default=a&&o,t.push(n),t},[])}else n.find(e=>e.selected).path=e,this.selectedRootDir=e,a()},{initialDir:s})},remove(){const{rootDirs:e,selectedRootDir:t,defaultRootDir:n,saveRootDirs:s}=this,a=e.findIndex(e=>e.selected),o=t,i=e.filter(e=>!e.selected);if(i.length>0){const e=a>0?a-1:0;this.selectedRootDir=i[e].path}else this.selectedRootDir=null;null!==this.defaultRootDir&&o===n&&(this.defaultRootDir=t),this.rootDirs=i,s()},setDefault(){const{selectedRootDir:e,defaultRootDir:t,saveRootDirs:n}=this;e!==t&&(this.defaultRootDir=e,n())},saveRootDirs(){const{$store:e,paths:t,defaultRootDir:n}=this,s=t.slice();if(null!==n&&0!==t.length){const e=s.findIndex(e=>e===n);s.splice(0,0,e.toString())}return e.dispatch("setConfig",{section:"main",config:{rootDirs:s}})}},watch:{rawRootDirs(e){const{transformRaw:t}=this;this.rootDirs=t(e)},rootDirs:{handler(t){this.$emit("update",t),this.$nextTick(()=>{e(this.$refs.rootDirs).trigger("change")})},deep:!0,immediate:!1},paths(e,t){JSON.stringify(e)!==JSON.stringify(t)&&this.$emit("update:paths",e)}}}}).call(this,n(5))},function(e,t,n){var s=n(220);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("571cda75",s,!1,{})},function(e,t,n){var s=n(223);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("760015ea",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(30),a=n.n(s),o=n(4),i=n.n(o),r=n(1),l=n(17),c=n(2);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function u(e){for(var t=1;t({presets:[{pattern:"%SN - %Sx%0E - %EN",example:"Show Name - 2x03 - Ep Name"},{pattern:"%S.N.S%0SE%0E.%E.N",example:"Show.Name.S02E03.Ep.Name"},{pattern:"%Sx%0E - %EN",example:"2x03 - Ep Name"},{pattern:"S%0SE%0E - %EN",example:"S02E03 - Ep Name"},{pattern:"Season %0S/%S.N.S%0SE%0E.%Q.N-%RG",example:"Season 02/Show.Name.S02E03.720p.HDTV-RLSGROUP"}],processMethods:[{value:"copy",text:"Copy"},{value:"move",text:"Move"},{value:"hardlink",text:"Hard Link"},{value:"symlink",text:"Symbolic Link"}],timezoneOptions:[{value:"local",text:"Local"},{value:"network",text:"Network"}],metadataProviderSelected:null}),methods:u({},Object(r.c)(["setConfig"]),{onChangeSyncFiles(e){const{postprocessing:t}=this;t.syncFiles=e.map(e=>e.value)},onChangeAllowedExtensions(e){const{postprocessing:t}=this;t.allowedExtensions=e.map(e=>e.value)},onChangeExtraScripts(e){const{postprocessing:t}=this;t.extraScripts=e.map(e=>e.value)},saveNaming(e){const{postprocessing:t}=this;this.configLoaded&&(t.naming.pattern=e.pattern,t.naming.multiEp=e.multiEpStyle)},saveNamingSports(e){const{postprocessing:t}=this;this.configLoaded&&(t.naming.patternSports=e.pattern,t.naming.enableCustomNamingSports=e.enabled)},saveNamingAbd(e){const{postprocessing:t}=this;this.configLoaded&&(t.naming.patternAirByDate=e.pattern,t.naming.enableCustomNamingAirByDate=e.enabled)},saveNamingAnime(e){const{postprocessing:t}=this;this.configLoaded&&(t.naming.patternAnime=e.pattern,t.naming.animeMultiEp=e.multiEpStyle,t.naming.animeNamingType=e.animeNamingType,t.naming.enableCustomNamingAnime=e.enabled)},async save(){const{postprocessing:e,metadata:t,setConfig:n}=this;if(!this.configLoaded)return;this.saving=!0;const s=Object.assign({},{postprocessing:e,metadata:t}),{multiEpStrings:o,reflinkAvailable:i}=e,r=a()(e,["multiEpStrings","reflinkAvailable"]);s.postProcessing=r;try{await n({section:"main",config:s}),this.$snotify.success("Saved Post-Processing config","Saved",{timeout:5e3})}catch(e){this.$snotify.error("Error while trying to save Post-Processing config","Error")}finally{this.saving=!1}},getFirstEnabledMetadataProvider(){const{metadata:e}=this,t=Object.values(e.metadataProviders).find(e=>e.showMetadata||e.episodeMetadata);return void 0===t?"kodi":t.id}}),computed:u({},Object(r.e)(["config","metadata","postprocessing","system"]),{configLoaded(){const{postprocessing:e}=this;return null!==e.processAutomatically},multiEpStringsSelect(){const{postprocessing:e}=this;return e.multiEpStrings?Object.keys(e.multiEpStrings).map(t=>({value:Number(t),text:e.multiEpStrings[t]})):[]}}),beforeMount(){this.$nextTick(()=>{e("#config-components").tabs()})},watch:{"metadata.metadataProviders":function(e){const{getFirstEnabledMetadataProvider:t}=this;Object.keys(e).length>0&&(this.metadataProviderSelected=t())}}}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(3),i=n(1),r=n(2);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function c(e){for(var t=1;t({prowlSelectedShow:null,prowlSelectedShowApiKeys:[],prowlPriorityOptions:[{text:"Very Low",value:-2},{text:"Moderate",value:-1},{text:"Normal",value:0},{text:"High",value:1},{text:"Emergency",value:2}],pushoverPriorityOptions:[{text:"Lowest",value:-2},{text:"Low",value:-1},{text:"Normal",value:0},{text:"High",value:1},{text:"Emergency",value:2}],pushoverSoundOptions:[{text:"Default",value:"default"},{text:"Pushover",value:"pushover"},{text:"Bike",value:"bike"},{text:"Bugle",value:"bugle"},{text:"Cash Register",value:"cashregister"},{text:"classical",value:"classical"},{text:"Cosmic",value:"cosmic"},{text:"Falling",value:"falling"},{text:"Gamelan",value:"gamelan"},{text:"Incoming",value:"incoming"},{text:"Intermission",value:"intermission"},{text:"Magic",value:"magic"},{text:"Mechanical",value:"mechanical"},{text:"Piano Bar",value:"pianobar"},{text:"Siren",value:"siren"},{text:"Space Alarm",value:"spacealarm"},{text:"Tug Boat",value:"tugboat"},{text:"Alien Alarm (long)",value:"alien"},{text:"Climb (long)",value:"climb"},{text:"Persistent (long)",value:"persistant"},{text:"Pushover Echo (long)",value:"echo"},{text:"Up Down (long)",value:"updown"},{text:"None (silent)",value:"none"}],pushbulletDeviceOptions:[{text:"All devices",value:""}],traktMethodOptions:[{text:"Skip all",value:0},{text:"Download pilot only",value:1},{text:"Get whole show",value:2}],pushbulletTestInfo:"Click below to test.",joinTestInfo:"Click below to test.",twitterTestInfo:"Click below to test.",twitterKey:"",emailSelectedShow:null,emailSelectedShowAdresses:[]}),computed:c({},Object(i.e)(["config","indexers","notifiers"]),{traktNewTokenMessage(){const{accessToken:e}=this.notifiers.trakt;return"New "},traktIndexersOptions(){const{indexers:e}=this,{traktIndexers:t}=e.main;return Object.keys(e.indexers).filter(e=>t[e]).map(t=>({text:t,value:e.indexers[t].id}))}}),created(){const{getShows:e}=this;e()},beforeMount(){this.$nextTick(()=>{e("#config-components").tabs()})},mounted(){e("#trakt_pin").on("keyup change",()=>{0===e("#trakt_pin").val().length?(e("#TraktGetPin").removeClass("hide"),e("#authTrakt").addClass("hide")):(e("#TraktGetPin").addClass("hide"),e("#authTrakt").removeClass("hide"))})},methods:c({},Object(i.c)(["getShows","setConfig"]),{onChangeProwlApi(e){this.notifiers.prowl.api=e.map(e=>e.value)},savePerShowNotifyList(e,t){const{emailSelectedShow:n,prowlSelectedShow:s}=this,a=new FormData;"prowl"===e?(a.set("show",s),a.set("prowlAPIs",t.map(e=>e.value))):(a.set("show",n),a.set("emails",t.map(e=>e.value))),o.c.post("home/saveShowNotifyList",a)},async prowlUpdateApiKeys(e){this.prowlSelectedShow=e;const t=await Object(o.c)("home/loadShowNotifyLists");if(t.data._size>0){const n=t.data[e].prowl_notify_list?t.data[e].prowl_notify_list.split(","):[];this.prowlSelectedShowApiKeys=e?n:[]}},async emailUpdateShowEmail(e){this.emailSelectedShow=e;const t=await Object(o.c)("home/loadShowNotifyLists");if(t.data._size>0){const n=t.data[e].list?t.data[e].list.split(","):[];this.emailSelectedShowAdresses=e?n:[]}},emailUpdateAddressList(e){this.notifiers.email.addressList=e.map(e=>e.value)},async getPushbulletDeviceOptions(){const{api:t}=this.notifiers.pushbullet;if(!t)return this.pushbulletTestInfo="You didn't supply a Pushbullet api key",e("#pushbullet_api").find("input").focus(),!1;const n=await Object(o.c)("home/getPushbulletDevices",{params:{api:t}}),s=[],{data:a}=n;if(!a)return!1;s.push({text:"All devices",value:""});for(const e of a.devices)!0===e.active&&s.push({text:e.nickname,value:e.iden});this.pushbulletDeviceOptions=s,this.pushbulletTestInfo="Device list updated. Please choose a device to push to."},async testPushbulletApi(){const{api:t}=this.notifiers.pushbullet;if(!t)return this.pushbulletTestInfo="You didn't supply a Pushbullet api key",e("#pushbullet_api").find("input").focus(),!1;const n=await Object(o.c)("home/testPushbullet",{params:{api:t}}),{data:s}=n;s&&(this.pushbulletTestInfo=s)},async testJoinApi(){const{api:t}=this.notifiers.join;if(!t)return this.joinTestInfo="You didn't supply a Join api key",e("#join_api").find("input").focus(),!1;const n=await Object(o.c)("home/testJoin",{params:{api:t}}),{data:s}=n;s&&(this.joinTestInfo=s)},async twitterStep1(){this.twitterTestInfo=MEDUSA.config.loading;const e=await Object(o.c)("home/twitterStep1"),{data:t}=e;window.open(t),this.twitterTestInfo="Step1: Confirm Authorization"},async twitterStep2(){const e={},{twitterKey:t}=this;if(e.key=t,e.key){const t=await Object(o.c)("home/twitterStep2",{params:{key:e.key}}),{data:n}=t;this.twitterTestInfo=n}else this.twitterTestInfo="Please fill out the necessary fields above."},async twitterTest(){try{const e=await Object(o.c)("home/testTwitter"),{data:t}=e;this.twitterTestInfo=t}catch(e){this.twitterTestInfo="Error while trying to request for a test on the twitter api."}},async save(){const{notifiers:e,setConfig:t}=this;this.saving=!0;try{await t({section:"main",config:{notifiers:e}}),this.$snotify.success("Saved Notifiers config","Saved",{timeout:5e3})}catch(e){this.$snotify.error("Error while trying to save notifiers config","Error")}finally{this.saving=!1}},testGrowl(){const t={};if(t.host=e.trim(e("#growl_host").val()),t.password=e.trim(e("#growl_password").val()),!t.host)return e("#testGrowl-result").html("Please fill out the necessary fields above."),void e("#growl_host").addClass("warning");e("#growl_host").removeClass("warning"),e(this).prop("disabled",!0),e("#testGrowl-result").html(MEDUSA.config.loading),e.get("home/testGrowl",{host:t.host,password:t.password}).done(t=>{e("#testGrowl-result").html(t),e("#testGrowl").prop("disabled",!1)})},testProwl(){const t={};if(t.api=e.trim(e("#prowl_api").find("input").val()),t.priority=e("#prowl_priority").find("input").val(),!t.api)return e("#testProwl-result").html("Please fill out the necessary fields above."),void e("#prowl_api").find("input").addClass("warning");e("#prowl_api").find("input").removeClass("warning"),e(this).prop("disabled",!0),e("#testProwl-result").html(MEDUSA.config.loading),e.get("home/testProwl",{prowl_api:t.api,prowl_priority:t.priority}).done(t=>{e("#testProwl-result").html(t),e("#testProwl").prop("disabled",!1)})},testKODI(){const t={},n=e.map(e("#kodi_host").find("input"),e=>e.value).filter(e=>""!==e);if(t.host=n.join(","),t.username=e.trim(e("#kodi_username").val()),t.password=e.trim(e("#kodi_password").val()),!t.host)return e("#testKODI-result").html("Please fill out the necessary fields above."),void e("#kodi_host").find("input").addClass("warning");e("#kodi_host").find("input").removeClass("warning"),e(this).prop("disabled",!0),e("#testKODI-result").html(MEDUSA.config.loading),e.get("home/testKODI",{host:t.host,username:t.username,password:t.password}).done(t=>{e("#testKODI-result").html(t),e("#testKODI").prop("disabled",!1)})},testPHT(){const t={client:{}},n=e.map(e("#plex_client_host").find("input"),e=>e.value).filter(e=>""!==e);if(t.client.host=n.join(","),t.client.username=e.trim(e("#plex_client_username").val()),t.client.password=e.trim(e("#plex_client_password").val()),!t.client.host)return e("#testPHT-result").html("Please fill out the necessary fields above."),void e("#plex_client_host").find("input").addClass("warning");e("#plex_client_host").find("input").removeClass("warning"),e(this).prop("disabled",!0),e("#testPHT-result").html(MEDUSA.config.loading),e.get("home/testPHT",{host:t.client.host,username:t.client.username,password:t.client.password}).done(t=>{e("#testPHT-result").html(t),e("#testPHT").prop("disabled",!1)})},testPMS(){const t={server:{}},n=e.map(e("#plex_server_host").find("input"),e=>e.value).filter(e=>""!==e);if(t.server.host=n.join(","),t.server.username=e.trim(e("#plex_server_username").val()),t.server.password=e.trim(e("#plex_server_password").val()),t.server.token=e.trim(e("#plex_server_token").val()),!t.server.host)return e("#testPMS-result").html("Please fill out the necessary fields above."),void e("#plex_server_host").find("input").addClass("warning");e("#plex_server_host").find("input").removeClass("warning"),e(this).prop("disabled",!0),e("#testPMS-result").html(MEDUSA.config.loading),e.get("home/testPMS",{host:t.server.host,username:t.server.username,password:t.server.password,plex_server_token:t.server.token}).done(t=>{e("#testPMS-result").html(t),e("#testPMS").prop("disabled",!1)})},testEMBY(){const t={};if(t.host=e("#emby_host").val(),t.apikey=e("#emby_apikey").val(),!t.host||!t.apikey)return e("#testEMBY-result").html("Please fill out the necessary fields above."),e("#emby_host").addRemoveWarningClass(t.host),void e("#emby_apikey").addRemoveWarningClass(t.apikey);e("#emby_host,#emby_apikey").children("input").removeClass("warning"),e(this).prop("disabled",!0),e("#testEMBY-result").html(MEDUSA.config.loading),e.get("home/testEMBY",{host:t.host,emby_apikey:t.apikey}).done(t=>{e("#testEMBY-result").html(t),e("#testEMBY").prop("disabled",!1)})},testBoxcar2(){const t={};if(t.accesstoken=e.trim(e("#boxcar2_accesstoken").val()),!t.accesstoken)return e("#testBoxcar2-result").html("Please fill out the necessary fields above."),void e("#boxcar2_accesstoken").addClass("warning");e("#boxcar2_accesstoken").removeClass("warning"),e(this).prop("disabled",!0),e("#testBoxcar2-result").html(MEDUSA.config.loading),e.get("home/testBoxcar2",{accesstoken:t.accesstoken}).done(t=>{e("#testBoxcar2-result").html(t),e("#testBoxcar2").prop("disabled",!1)})},testPushover(){const t={};if(t.userkey=e("#pushover_userkey").val(),t.apikey=e("#pushover_apikey").val(),!t.userkey||!t.apikey)return e("#testPushover-result").html("Please fill out the necessary fields above."),e("#pushover_userkey").addRemoveWarningClass(t.userkey),void e("#pushover_apikey").addRemoveWarningClass(t.apikey);e("#pushover_userkey,#pushover_apikey").removeClass("warning"),e(this).prop("disabled",!0),e("#testPushover-result").html(MEDUSA.config.loading),e.get("home/testPushover",{userKey:t.userkey,apiKey:t.apikey}).done(t=>{e("#testPushover-result").html(t),e("#testPushover").prop("disabled",!1)})},testLibnotify(){e("#testLibnotify-result").html(MEDUSA.config.loading),e.get("home/testLibnotify",t=>{e("#testLibnotify-result").html(t)})},settingsNMJ(){const t={};t.host=e("#nmj_host").val(),t.host?(e("#testNMJ-result").html(MEDUSA.config.loading),e.get("home/settingsNMJ",{host:t.host},t=>{null===t&&(e("#nmj_database").removeAttr("readonly"),e("#nmj_mount").removeAttr("readonly"));const n=e.parseJSON(t);e("#testNMJ-result").html(n.message),e("#nmj_database").val(n.database),e("#nmj_mount").val(n.mount),n.database?e("#nmj_database").prop("readonly",!0):e("#nmj_database").removeAttr("readonly"),n.mount?e("#nmj_mount").prop("readonly",!0):e("#nmj_mount").removeAttr("readonly")})):(alert("Please fill in the Popcorn IP address"),e("#nmj_host").focus())},testNMJ(){const t={};t.host=e.trim(e("#nmj_host").val()),t.database=e("#nmj_database").val(),t.mount=e("#nmj_mount").val(),t.host?(e("#nmj_host").removeClass("warning"),e(this).prop("disabled",!0),e("#testNMJ-result").html(MEDUSA.config.loading),e.get("home/testNMJ",{host:t.host,database:t.database,mount:t.mount}).done(t=>{e("#testNMJ-result").html(t),e("#testNMJ").prop("disabled",!1)})):(e("#testNMJ-result").html("Please fill out the necessary fields above."),e("#nmj_host").addClass("warning"))},settingsNMJv2(){const t={};if(t.host=e("#nmjv2_host").val(),t.host){e("#testNMJv2-result").html(MEDUSA.config.loading),t.dbloc="";const n=document.getElementsByName("nmjv2_dbloc");for(let e=0,s=n.length;e{null===t&&e("#nmjv2_database").removeAttr("readonly");const n=e.parseJSON(t);e("#testNMJv2-result").html(n.message),e("#nmjv2_database").val(n.database),n.database?e("#nmjv2_database").prop("readonly",!0):e("#nmjv2_database").removeAttr("readonly")})}else alert("Please fill in the Popcorn IP address"),e("#nmjv2_host").focus()},testNMJv2(){const t={};t.host=e.trim(e("#nmjv2_host").val()),t.host?(e("#nmjv2_host").removeClass("warning"),e(this).prop("disabled",!0),e("#testNMJv2-result").html(MEDUSA.config.loading),e.get("home/testNMJv2",{host:t.host}).done(t=>{e("#testNMJv2-result").html(t),e("#testNMJv2").prop("disabled",!1)})):(e("#testNMJv2-result").html("Please fill out the necessary fields above."),e("#nmjv2_host").addClass("warning"))},testFreeMobile(){const t={};if(t.id=e.trim(e("#freemobile_id").val()),t.apikey=e.trim(e("#freemobile_apikey").val()),!t.id||!t.apikey)return e("#testFreeMobile-result").html("Please fill out the necessary fields above."),t.id?e("#freemobile_id").removeClass("warning"):e("#freemobile_id").addClass("warning"),void(t.apikey?e("#freemobile_apikey").removeClass("warning"):e("#freemobile_apikey").addClass("warning"));e("#freemobile_id,#freemobile_apikey").removeClass("warning"),e(this).prop("disabled",!0),e("#testFreeMobile-result").html(MEDUSA.config.loading),e.get("home/testFreeMobile",{freemobile_id:t.id,freemobile_apikey:t.apikey}).done(t=>{e("#testFreeMobile-result").html(t),e("#testFreeMobile").prop("disabled",!1)})},testTelegram(){const t={};if(t.id=e.trim(e("#telegram_id").val()),t.apikey=e.trim(e("#telegram_apikey").val()),!t.id||!t.apikey)return e("#testTelegram-result").html("Please fill out the necessary fields above."),e("#telegram_id").addRemoveWarningClass(t.id),void e("#telegram_apikey").addRemoveWarningClass(t.apikey);e("#telegram_id,#telegram_apikey").removeClass("warning"),e(this).prop("disabled",!0),e("#testTelegram-result").html(MEDUSA.config.loading),e.get("home/testTelegram",{telegram_id:t.id,telegram_apikey:t.apikey}).done(t=>{e("#testTelegram-result").html(t),e("#testTelegram").prop("disabled",!1)})},testDiscord(){const{notifiers:t}=this;if(!t.discord.webhook)return e("#testDiscord-result").html("Please fill out the necessary fields above."),void e("#discord_webhook").addRemoveWarningClass(t.discord.webhook);e("#discord_id,#discord_apikey").removeClass("warning"),e(this).prop("disabled",!0),e("#testDiscord-result").html(MEDUSA.config.loading),e.get("home/testDiscord",{discord_webhook:t.discord.webhook,discord_tts:t.discord.tts}).done(t=>{e("#testDiscord-result").html(t),e("#testDiscord").prop("disabled",!1)})},testSlack(){const t={};if(t.webhook=e.trim(e("#slack_webhook").val()),!t.webhook)return e("#testSlack-result").html("Please fill out the necessary fields above."),void e("#slack_webhook").addRemoveWarningClass(t.webhook);e("#slack_webhook").removeClass("warning"),e(this).prop("disabled",!0),e("#testSlack-result").html(MEDUSA.config.loading),e.get("home/testslack",{slack_webhook:t.webhook}).done(t=>{e("#testSlack-result").html(t),e("#testSlack").prop("disabled",!1)})},TraktGetPin(){window.open(e("#trakt_pin_url").val(),"popUp","toolbar=no, scrollbars=no, resizable=no, top=200, left=200, width=650, height=550"),e("#trakt_pin").prop("disabled",!1)},authTrakt(){const t={};t.pin=e("#trakt_pin").val(),0!==t.pin.length&&e.get("home/getTraktToken",{trakt_pin:t.pin}).done(t=>{e("#testTrakt-result").html(t),e("#authTrakt").addClass("hide"),e("#trakt_pin").prop("disabled",!0),e("#trakt_pin").val(""),e("#TraktGetPin").removeClass("hide")})},testTrakt(){const t={};return t.username=e.trim(e("#trakt_username").val()),t.trendingBlacklist=e.trim(e("#trakt_blacklist_name").val()),t.username?/\s/g.test(t.trendingBlacklist)?(e("#testTrakt-result").html("Check blacklist name; the value needs to be a trakt slug"),void e("#trakt_blacklist_name").addClass("warning")):(e("#trakt_username").removeClass("warning"),e("#trakt_blacklist_name").removeClass("warning"),e(this).prop("disabled",!0),e("#testTrakt-result").html(MEDUSA.config.loading),void e.get("home/testTrakt",{username:t.username,blacklist_name:t.trendingBlacklist}).done(t=>{e("#testTrakt-result").html(t),e("#testTrakt").prop("disabled",!1)})):(e("#testTrakt-result").html("Please fill out the necessary fields above."),void e("#trakt_username").addRemoveWarningClass(t.username))},traktForceSync(){e("#testTrakt-result").html(MEDUSA.config.loading),e.getJSON("home/forceTraktSync",t=>{e("#testTrakt-result").html(t.result)})},testEmail(){let t="";const n=e("#testEmail-result");n.html(MEDUSA.config.loading);let s=e("#email_host").val();s=s.length>0?s:null;let a=e("#email_port").val();a=a.length>0?a:null;const o=e("#email_tls").find("input").is(":checked")?1:0;let i=e("#email_from").val();i=i.length>0?i:"root@localhost";const r=e("#email_username").val().trim(),l=e("#email_password").val();let c="";null===s&&(c+='
  • You must specify an SMTP hostname!
  • '),null===a?c+='
  • You must specify an SMTP port!
  • ':(null===a.match(/^\d+$/)||parseInt(a,10)>65535)&&(c+='
  • SMTP port must be between 0 and 65535!
  • '),c.length>0?(c="
      "+c+"
    ",n.html(c)):null===(t=prompt("Enter an email address to send the test to:",null))||0===t.length||null===t.match(/.*@.*/)?n.html('

    You must provide a recipient email address!

    '):e.get("home/testEmail",{host:s,port:a,smtp_from:i,use_tls:o,user:r,pwd:l,to:t},t=>{e("#testEmail-result").html(t)})},testPushalot(){const t={};if(t.authToken=e.trim(e("#pushalot_authorizationtoken").val()),!t.authToken)return e("#testPushalot-result").html("Please fill out the necessary fields above."),void e("#pushalot_authorizationtoken").addClass("warning");e("#pushalot_authorizationtoken").removeClass("warning"),e(this).prop("disabled",!0),e("#testPushalot-result").html(MEDUSA.config.loading),e.get("home/testPushalot",{authorizationToken:t.authToken}).done(t=>{e("#testPushalot-result").html(t),e("#testPushalot").prop("disabled",!1)})}})}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(3),i=n(1),r=n(2);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function c(e){for(var t=1;t({configLoaded:!1,checkPropersIntervalLabels:[{text:"24 hours",value:"daily"},{text:"4 hours",value:"4h"},{text:"90 mins",value:"90m"},{text:"45 mins",value:"45m"},{text:"30 mins",value:"30m"},{text:"15 mins",value:"15m"}],nzbGetPriorityOptions:[{text:"Very low",value:-100},{text:"Low",value:-50},{text:"Normal",value:0},{text:"High",value:50},{text:"Very high",value:100},{text:"Force",value:900}],clientsConfig:{torrent:{blackhole:{title:"Black hole"},utorrent:{title:"uTorrent",description:"URL to your uTorrent client (e.g. http://localhost:8000)",labelOption:!0,labelAnimeOption:!0,seedTimeOption:!0,pausedOption:!0,testStatus:"Click below to test"},transmission:{title:"Transmission",description:"URL to your Transmission client (e.g. http://localhost:9091)",pathOption:!0,removeFromClientOption:!0,seedLocationOption:!0,seedTimeOption:!0,pausedOption:!0,testStatus:"Click below to test"},deluge:{title:"Deluge (via WebUI)",shortTitle:"Deluge",description:"URL to your Deluge client (e.g. http://localhost:8112)",pathOption:!0,removeFromClientOption:!0,labelOption:!0,labelAnimeOption:!0,seedLocationOption:!0,pausedOption:!0,verifyCertOption:!0,testStatus:"Click below to test"},deluged:{title:"Deluge (via Daemon)",shortTitle:"Deluge",description:"IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)",pathOption:!0,removeFromClientOption:!0,labelOption:!0,labelAnimeOption:!0,seedLocationOption:!0,pausedOption:!0,verifyCertOption:!0,testStatus:"Click below to test"},downloadstation:{title:"Synology DS",description:"URL to your Synology DS client (e.g. http://localhost:5000)",pathOption:!0,testStatus:"Click below to test"},rtorrent:{title:"rTorrent",description:"URL to your rTorrent client (e.g. scgi://localhost:5000
    or https://localhost/rutorrent/plugins/httprpc/action.php)",pathOption:!0,labelOption:!0,labelAnimeOption:!0,verifyCertOption:!0,testStatus:"Click below to test"},qbittorrent:{title:"qBittorrent",description:"URL to your qBittorrent client (e.g. http://localhost:8080)",labelOption:!0,labelAnimeOption:!0,pausedOption:!0,testStatus:"Click below to test"},mlnet:{title:"MLDonkey",description:"URL to your MLDonkey (e.g. http://localhost:4080)",verifyCertOption:!0,testStatus:"Click below to test"}},nzb:{blackhole:{title:"Black hole"},nzbget:{title:"NZBget",description:"NZBget RPC host name and port number (not NZBgetweb!) (e.g. localhost:6789)",testStatus:"Click below to test"},sabnzbd:{title:"SABnzbd",description:"URL to your SABnzbd server (e.g. http://localhost:8080/)",testStatus:"Click below to test"}}},httpAuthTypes:{none:"None",basic:"Basic",digest:"Digest"}}),computed:c({},Object(i.e)(["clients","search","system"]),{torrentUsernameIsDisabled(){const{clients:e}=this,{torrents:t}=e,{host:n,method:s}=t,a=n||"";return!(!["rtorrent","deluge"].includes(s)||"rtorrent"===s&&!a.startsWith("scgi://"))},torrentPasswordIsDisabled(){const{clients:e}=this,{torrents:t}=e,{host:n,method:s}=t;return!("rtorrent"!==s||"rtorrent"===s&&!(n||"").startsWith("scgi://"))},authTypeIsDisabled(){const{clients:e}=this,{torrents:t}=e,{host:n,method:s}=t;return!("rtorrent"===s&&!(n||"").startsWith("scgi://"))}}),beforeMount(){this.$nextTick(()=>{e("#config-components").tabs()})},methods:c({},Object(i.c)(["setConfig"]),{async testTorrentClient(){const{clients:e}=this,{torrents:t}=e,{method:n,host:s,username:a,password:i}=t;this.clientsConfig.torrent[n].testStatus=MEDUSA.config.loading;const r={torrent_method:n,host:s,username:a,password:i},l=await o.c.get("home/testTorrent",{params:r});this.clientsConfig.torrent[n].testStatus=l.data},async testNzbget(){const{clients:e}=this,{nzb:t}=e,{nzbget:n}=t,{host:s,username:a,password:i,useHttps:r}=n;this.clientsConfig.nzb.nzbget.testStatus=MEDUSA.config.loading;const l={host:s,username:a,password:i,use_https:r},c=await o.c.get("home/testNZBget",{params:l});this.clientsConfig.nzb.nzbget.testStatus=c.data},async testSabnzbd(){const{clients:e}=this,{nzb:t}=e,{sabnzbd:n}=t,{host:s,username:a,password:i,apiKey:r}=n;this.clientsConfig.nzb.sabnzbd.testStatus=MEDUSA.config.loading;const l={host:s,username:a,password:i,apikey:r},c=await o.c.get("home/testSABnzbd",{params:l});this.clientsConfig.nzb.sabnzbd.testStatus=c.data},async save(){const{clients:e,search:t,setConfig:n}=this;this.saving=!0;const s=Object.assign({},{search:t},{clients:e});try{await n({section:"main",config:s}),this.$snotify.success("Saved Search config","Saved",{timeout:5e3})}catch(e){this.$snotify.error("Error while trying to save search config","Error")}finally{this.saving=!1}}}),watch:{"clients.torrents.host"(e){const{clients:t}=this,{torrents:n}=t,{method:s}=n;if("rtorrent"===s){if(!e)return;e.startsWith("scgi://")&&(this.clients.torrents.username="",this.clients.torrents.password="",this.clients.torrents.authType="none")}"deluge"===s&&(this.clients.torrents.username="")},"clients.torrents.method"(e){this.clientsConfig.torrent[e].removeFromClientOption||(this.search.general.removeFromClient=!1)}}}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(30),a=n.n(s),o=n(4),i=n.n(o),r=n(19),l=n(136),c=n(1),d=n(2),u=n(6),p=n(32),h=n(83),f=n(21),m=n(27),g=n(78),v=n(137),b=n(135),_=n.n(b),w=n(79);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function x(e){for(var t=1;t{const{getSceneNumbering:t}=this;return t(e)},sortable:!1,hidden:e("displayShow-hide-field-Scene")},{label:"Scene Abs. #",field:e=>{const{getSceneAbsoluteNumbering:t}=this;return t(e)},type:"number",sortFn:(e,t)=>et?1:0,hidden:e("displayShow-hide-field-Scene Abs. #")},{label:"Title",field:"title",hidden:e("displayShow-hide-field-Title")},{label:"File",field:"file.location",hidden:e("displayShow-hide-field-File")},{label:"Size",field:"file.size",type:"number",formatFn:u.e,hidden:e("displayShow-hide-field-Size")},{label:"Air date",field:this.parseDateFn,sortable:!1,hidden:e("displayShow-hide-field-Air date")},{label:"Download",field:"download",sortable:!1,hidden:e("displayShow-hide-field-Download")},{label:"Subtitles",field:"subtitles",sortable:!1,hidden:e("displayShow-hide-field-Subtitles")},{label:"Status",field:"status",hidden:e("displayShow-hide-field-Status")},{label:"Search",field:"search",sortable:!1,hidden:e("displayShow-hide-field-Search")}],perPageDropdown:t,paginationPerPage:(()=>{const n=e("displayShow-pagination-perPage");return n?t.includes(n)?n:500:50})(),selectedEpisodes:[],failedSearchEpisode:null,backlogSearchEpisodes:[],filterByOverviewStatus:!1,timeAgo:new v.a("en-US")}},computed:x({},Object(c.e)({shows:e=>e.shows.shows,configLoaded:e=>null!==e.layout.fanartBackground,config:e=>e.config,layout:e=>e.layout,stateSearch:e=>e.search}),{},Object(c.d)({show:"getCurrentShow",getOverviewStatus:"getOverviewStatus"}),{indexer(){return this.showIndexer||this.$route.query.indexername},id(){return this.showId||Number(this.$route.query.seriesid)||void 0},theme(){const{layout:e}=this,{themeName:t}=e;return t||"light"},orderSeasons(){const{filterByOverviewStatus:e,invertTable:t,layout:n,show:s}=this;if(!s.seasons)return[];let o=s.seasons.sort((e,t)=>e.season-t.season).filter(e=>0!==e.season||n.show.specials);if(e&&e.filter(e=>e.checked).length{const n=this.getOverviewStatus(t.status,t.quality,s.config.qualities),a=e.find(e=>e.name===n);return!a||a.checked});t.push(Object.assign({episodes:r},i))}o=t}return t?o.reverse():o}}),created(){const{getShows:e}=this;e()},mounted(){const{id:t,indexer:n,getShow:s,setEpisodeSceneNumbering:a,setAbsoluteSceneNumbering:o,setInputValidInvalid:i,$store:r}=this;r.commit("currentShow",{indexer:n,id:t}),s({id:t,indexer:n,detailed:!0}),this.$watch("show",()=>{this.$nextTick(()=>this.reflowLayout())}),["load","resize"].map(e=>window.addEventListener(e,()=>{this.reflowLayout()})),e(document.body).on("click",".seasonCheck",t=>{const n=t.currentTarget,s=e(n).attr("id");e("#collapseSeason-"+s).collapse("show");const a="s"+s;e(".epCheck:visible").each((t,s)=>{e(s).attr("id").split("e")[0]===a&&(s.checked=n.checked)})}),e(document.body).on("change",".sceneSeasonXEpisode",t=>{const n=t.currentTarget,s=e(n).val();e(n).val(s.replace(/[^0-9xX]*/g,""));const o=e(n).attr("data-for-season"),r=e(n).attr("data-for-episode");if(""===s)return void a(o,r,null,null);const l=e(n).val().match(/^(\d+)x(\d+)$/i),c=e(n).val().match(/^(\d+)$/i);let d=null,u=null,p=!1;l?(d=l[1],u=l[2],p=i(!0,e(n))):c?(d=o,u=c[1],p=i(!0,e(n))):p=i(!1,e(n)),p&&a(o,r,d,u)}),e(document.body).on("change",".sceneAbsolute",t=>{const n=t.currentTarget;e(n).val(e(n).val().replace(/[^0-9xX]*/g,""));const s=e(n).attr("data-for-absolute"),a=e(n).val().match(/^(\d{1,3})$/i);let i=null;a&&(i=a[1]),o(s,i)})},methods:x({humanFileSize:u.e},Object(c.c)({getShow:"getShow",getShows:"getShows",getEpisodes:"getEpisodes"}),{statusQualityUpdate(e){const{selectedEpisodes:t,setStatus:n,setQuality:s}=this;null!==e.newQuality&&"Change quality to:"!==e.newQuality&&s(e.newQuality,t),null!==e.newStatus&&"Change status to:"!==e.newStatus&&n(e.newStatus,t)},setQuality(e,t){const{id:n,indexer:s,getEpisodes:a,show:o}=this,i={};t.forEach(t=>{i[t.slug]={quality:parseInt(e,10)}}),api.patch("series/"+o.id.slug+"/episodes",i).then(i=>{console.info("patched show ".concat(o.id.slug," with quality ").concat(e)),[...new Set(t.map(e=>e.season))].forEach(e=>{a({id:n,indexer:s,season:e})})}).catch(e=>{console.error(String(e))})},setStatus(e,t){const{id:n,indexer:s,getEpisodes:a,show:o}=this,i={};t.forEach(t=>{i[t.slug]={status:e}}),api.patch("series/"+o.id.slug+"/episodes",i).then(i=>{console.info("patched show ".concat(o.id.slug," with status ").concat(e)),[...new Set(t.map(e=>e.season))].forEach(e=>{a({id:n,indexer:s,season:e})})}).catch(e=>{console.error(String(e))}),3===e&&this.$modal.show("query-start-backlog-search",{episodes:t})},parseDateFn(e){const{layout:t,timeAgo:n}=this,{dateStyle:s,timeStyle:a}=t,{fuzzyDating:o}=t;if(!e.airDate)return"";if(o)return n.format(new Date(e.airDate));if("%x"===s)return new Date(e.airDate).toLocaleString();const i=Object(l.a)(e.airDate);return Object(r.a)(i,Object(u.d)("".concat(s," ").concat(a)))},rowStyleClassFn(e){const{getOverviewStatus:t,show:n}=this;return t(e.status,e.quality,n.config.qualities).toLowerCase().trim()},addFileSize:e=>Object(u.e)(e.episodes.reduce((e,t)=>e+(t.file.size||0),0)),searchSubtitle(e,t,n){const{id:s,indexer:a,getEpisodes:o,show:i,subtitleSearchComponents:r}=this,l=new(Vue.extend(g.a))({propsData:{show:i,season:t.season,episode:t.episode,key:t.originalIndex,lang:n},parent:this});l.$on("update",e=>{"new subtitles found"===e.reason&&o({id:s,indexer:a,season:t.season})});const c=document.createElement("div");this.$refs["table-seasons"].$refs["row-".concat(t.originalIndex)][0].after(c),l.$mount(c),r.push(l)},reflowLayout(){console.debug("Reflowing layout"),this.$nextTick(()=>{this.movecheckboxControlsBackground()}),Object(p.a)()},movecheckboxControlsBackground(){const t=e("#checkboxControls").height()+10,n=e("#checkboxControls").offset().top-3;e("#checkboxControlsBackground").height(t),e("#checkboxControlsBackground").offset({top:n,left:0}),e("#checkboxControlsBackground").show()},setEpisodeSceneNumbering(t,n,s,a){const{$snotify:o,id:i,indexer:r,show:l}=this;l.config.scene||o.warning("To change episode scene numbering you need to enable the show option `scene` first","Warning",{timeout:0}),""===s&&(s=null),""===a&&(a=null),e.getJSON("home/setSceneNumbering",{indexername:r,seriesid:i,forSeason:t,forEpisode:n,sceneSeason:s,sceneEpisode:a},s=>{null===s.sceneSeason||null===s.sceneEpisode?e("#sceneSeasonXEpisode_"+i+"_"+t+"_"+n).val(""):e("#sceneSeasonXEpisode_"+i+"_"+t+"_"+n).val(s.sceneSeason+"x"+s.sceneEpisode),s.success||(s.errorMessage?alert(s.errorMessage):alert("Update failed."))})},setAbsoluteSceneNumbering(t,n){const{$snotify:s,id:a,indexer:o,show:i}=this;i.config.scene||s.warning("To change an anime episode scene numbering you need to enable the show option `scene` first","Warning",{timeout:0}),""===n&&(n=null),e.getJSON("home/setSceneNumbering",{indexername:o,seriesid:a,forAbsolute:t,sceneAbsolute:n},n=>{null===n.sceneAbsolute?e("#sceneAbsolute_"+a+"_"+t).val(""):e("#sceneAbsolute_"+a+"_"+t).val(n.sceneAbsolute),n.success||(n.errorMessage?alert(n.errorMessage):alert("Update failed."))})},setInputValidInvalid:(t,n)=>t?(e(n).css({"background-color":"#90EE90",color:"#FFF","font-weight":"bold"}),!0):(e(n).css({"background-color":"#FF0000",color:"#FFF !important","font-weight":"bold"}),!1),anyEpisodeNotUnaired:e=>e.episodes.filter(e=>"Unaired"!==e.status).length>0,episodesInverse(e){const{invertTable:t}=this;return e.episodes?t?e.episodes.slice().reverse():e.episodes:[]},getSceneNumbering(e){const{show:t}=this,{sceneNumbering:n,xemNumbering:s}=t;if(!t.config.scene)return{season:0,episode:0};if(0!==n.length){const t=n.filter(t=>t.source.season===e.season&&t.source.episode===e.episode);if(0!==t.length)return t[0].destination}if(0!==s.length){const t=s.filter(t=>t.source.season===e.season&&t.source.episode===e.episode);if(0!==t.length)return t[0].destination}return{season:e.scene.season||0,episode:e.scene.episode||0}},getSceneAbsoluteNumbering(e){const{show:t}=this,{sceneAbsoluteNumbering:n,xemAbsoluteNumbering:s}=t;return t.config.anime&&t.config.scene?Object.keys(n).length>0&&n[e.absoluteNumber]?n[e.absoluteNumber].sceneAbsolute:Object.keys(s).length>0&&s[e.absoluteNumber]?s[e.absoluteNumber].sceneAbsolute:e.scene.absoluteNumber:e.scene.absoluteNumber},beforeBacklogSearchModalClose(e){this.backlogSearchEpisodes=e.params.episodes},beforeFailedSearchModalClose(e){this.failedSearchEpisode=e.params.episode},retryDownload(e){const{stateSearch:t}=this;return t.general.failedDownloads.enabled&&["Snatched","Snatched (Proper)","Snatched (Best)","Downloaded"].includes(e.status)},search(e,t){const{show:n}=this;let s={};e&&(s={showSlug:n.id.slug,episodes:[],options:{}},e.forEach(e=>{s.episodes.push(e.slug),this.$refs["search-".concat(e.slug)].src="images/loading16-dark.gif"})),api.put("search/".concat(t),s).then(t=>{1===e.length?(console.info("started search for show: ".concat(n.id.slug," episode: ").concat(e[0].slug)),this.$refs["search-".concat(e[0].slug)].src="images/queued.png",this.$refs["search-".concat(e[0].slug)].disabled=!0):console.info("started a full backlog search")}).catch(t=>{console.error(String(t)),e.forEach(t=>{s.episodes.push(t.slug),this.$refs["search-".concat(e[0].slug)].src="images/no16.png"})}).finally(()=>{this.failedSearchEpisode=null,this.backlogSearchEpisodes=[]})},queueSearch(e){const{$modal:t,search:n,retryDownload:s}=this,a=e.slug;if(e){if(!0===this.$refs["search-".concat(a)].disabled)return;s(e)?t.show("query-mark-failed-and-search",{episode:e}):n([e],"backlog")}},showSubtitleButton(e){const{config:t,show:n}=this;return 0!==e.season&&t.subtitles.enabled&&n.config.subtitlesEnabled&&!["Snatched","Snatched (Proper)","Snatched (Best)","Downloaded"].includes(e.status)},totalSeasonEpisodeSize:e=>e.episodes.filter(e=>e.file&&e.file.size>0).reduce((e,t)=>e+t.file.size,0),getSeasonExceptions(e){const{show:t}=this,{allSceneExceptions:n}=t;let s={class:"display: none"},a=[],o=!1;if(t.xemNumbering.length>0){const n=t.xemNumbering.filter(t=>t.source.season===e);a=[...new Set(n.map(e=>e.destination.season))],o=Boolean(a.length)}return n.find(t=>t.season===e)&&(s={id:"xem-exception-season-".concat(o?a[0]:e),alt:o?"[xem]":"[medusa]",src:o?"images/xem.png":"images/ico/favicon-16.png",title:o?a.reduce((e,t)=>e.concat(n.find(e=>e.season===t).exceptions),[]).join(", "):n.find(t=>t.season===e).exceptions.join(", ")}),s},getCookie(e){const t=this.$cookies.get(e);return JSON.parse(t)},setCookie(e,t){return this.$cookies.set(e,JSON.stringify(t))},updateEpisodeWatched(e,t){const{id:n,indexer:s,getEpisodes:a,show:o}=this,i={};i[e.slug]={watched:t},api.patch("series/".concat(o.id.slug,"/episodes"),i).then(o=>{console.info("patched episode ".concat(e.slug," with watched set to ").concat(t)),a({id:n,indexer:s,season:e.season})}).catch(e=>{console.error(String(e))}),e.watched=t},updatePaginationPerPage(e){const{setCookie:t}=this;this.paginationPerPage=e,t("displayShow-pagination-perPage",e)}}),watch:{"show.id.slug":function(e){if(e){Object(p.c)(e,this);const{id:t,indexer:n,getEpisodes:s,show:a}=this;if(!a.seasons){(async(e,t)=>{for(const n of a.seasonCount.map(e=>e.season).reverse())await s({id:e,indexer:t,season:n})})(t,n)}}},columns:{handler:function(e){const{setCookie:t}=this;for(const n of e)n&&t("displayShow-hide-field-".concat(n.label),n.hidden)},deep:!0}}}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(132),i=n(133),r=n(134),l=n(1),c=n(3),d=n(6),u=n(32),p=n(2);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function f(e){for(var t=1;te.find(e=>!Number.isNaN(e)&&null!=e);t.a={name:"show-header",components:{AppLink:p.a,Asset:p.b,QualityPill:p.l,StateSwitch:p.p,Truncate:o.a},props:{type:{type:String,default:"show",validator:e=>["show","snatch-selection"].includes(e)},showIndexer:{type:String},showId:{type:Number},showSeason:{type:Number},showEpisode:{type:Number},manualSearchType:{type:String}},data:()=>({jumpToSeason:"jump",selectedStatus:"Change status to:",selectedQuality:"Change quality to:",overviewStatus:[{id:"wanted",checked:!0,name:"Wanted"},{id:"allowed",checked:!0,name:"Allowed"},{id:"preferred",checked:!0,name:"Preferred"},{id:"skipped",checked:!0,name:"Skipped"},{id:"snatched",checked:!0,name:"Snatched"}]}),computed:f({},Object(l.e)({config:e=>e.config,layout:e=>e.layout,shows:e=>e.shows.shows,indexerConfig:e=>e.indexers.indexers,displaySpecials:e=>e.layout.show.specials,qualities:e=>e.consts.qualities.values,statuses:e=>e.consts.statuses,search:e=>e.search,configLoaded:e=>null!==e.layout.fanartBackground}),{},Object(l.d)({show:"getCurrentShow",getOverviewStatus:"getOverviewStatus",getQualityPreset:"getQualityPreset",getStatus:"getStatus"}),{indexer(){return this.showIndexer||this.$route.query.indexername},id(){return this.showId||Number(this.$route.query.seriesid)||void 0},season(){return m(this.showSeason,Number(this.$route.query.season))},episode(){return m(this.showEpisode,Number(this.$route.query.episode))},showIndexerUrl(){const{show:e,indexerConfig:t}=this;if(!e.indexer)return;const n=e.id[e.indexer],s=t[e.indexer].showUrl;return"".concat(s).concat(n)},activeShowQueueStatuses(){const{showQueueStatus:e}=this.show;return e?e.filter(e=>!0===e.active):[]},showGenres(){const{show:e,dedupeGenres:t}=this,{imdbInfo:n}=e,{genres:s}=n;let a=[];return s&&(a=t(s.split("|"))),a},episodeSummary(){const{getOverviewStatus:e,show:t}=this,{seasons:n}=t,s={Downloaded:0,Skipped:0,Wanted:0,Allowed:0,Preferred:0,Unaired:0,Snatched:0,"Snatched (Proper)":0,"Snatched (Best)":0,Unset:0};return n.forEach(n=>{n.episodes.forEach(n=>{s[e(n.status,n.quality,t.config.qualities)]+=1})}),s},changeStatusOptions(){const{search:e,getStatus:t,statuses:n}=this;if(0===n.length)return[];const s=["wanted","skipped","ignored","downloaded","archived"].map(e=>t({key:e}));return e.useFailedDownloads&&s.push(t({key:"failed"})),s},combinedQualities(){const{allowed:e,preferred:t}=this.show.config.qualities;return Object(d.c)(e,t)},seasons(){const{show:e}=this;return e.seasonCount.map(e=>e.season)}}),mounted(){["load","resize"].map(e=>window.addEventListener(e,()=>{this.reflowLayout()})),this.$watch("show",function(e){if(e){const{reflowLayout:e}=this;this.$nextTick(()=>e())}},{deep:!0})},methods:f({},Object(l.c)(["setSpecials"]),{combineQualities:d.c,humanFileSize:d.e,changeStatusClicked(){const{changeStatusOptions:e,changeQualityOptions:t,selectedStatus:n,selectedQuality:s}=this;this.$emit("update",{newStatus:n,newQuality:s,statusOptions:e,qualityOptions:t})},toggleSpecials(){const{setSpecials:e}=this;e(!this.displaySpecials)},reverse:e=>e?e.slice().reverse():[],dedupeGenres:e=>e?[...new Set(e.slice(0).map(e=>e.replace("-"," ")))]:[],getCountryISO2ToISO3:e=>Object(i.getLanguage)(e).iso639_2en,toggleConfigOption(e){const{show:t}=this,{config:n}=t;this.show.config[e]=!this.show.config[e];const s={config:{[e]:n[e]}};c.a.patch("series/"+t.id.slug,s).then(t=>{this.$snotify.success("".concat(s.config[e]?"enabled":"disabled"," show option ").concat(e),"Saved",{timeout:5e3})}).catch(e=>{this.$snotify.error('Error while trying to save "'+t.title+'": '+e.message||!1,"Error")})},reflowLayout(){this.$nextTick(()=>{this.moveSummaryBackground()}),Object(u.b)()},moveSummaryBackground(){const t=e("#summary");if(0===Object.keys(t).length)return;const n=t.height()+10,s=t.offset().top+5;e("#summaryBackground").height(n),e("#summaryBackground").offset({top:s,left:0}),e("#summaryBackground").show()}}),watch:{jumpToSeason(e){if("jump"!==e){let t=50*(this.seasons.length-e);t=Math.max(500,Math.min(t,2e3));let n=-50;n-=window.matchMedia("(min-width: 1281px)").matches?40:0;const s="season-".concat(e);console.debug("Jumping to #".concat(s," (").concat(t,"ms)")),Object(r.scrollTo)('[name="'.concat(s,'"]'),t,{container:"body",easing:"ease-in-out",offset:n}),window.location.hash=s,this.jumpToSeason="jump"}}}}}).call(this,n(5))},function(e,t,n){var s=n(229);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("2ce901e6",s,!1,{})},function(e,t,n){var s=n(231);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("4dd134cc",s,!1,{})},function(e,t,n){var s=n(243);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(12).default)("05f22efc",s,!1,{})},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1),i=n(6),r=n(26),l=n(21),c=n(2);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function u(e){for(var t=1;t({saving:!1,loadError:null}),computed:u({},Object(o.e)({indexers:e=>e.indexers,layout:e=>e.layout,episodeStatuses:e=>e.consts.statuses}),{},Object(o.d)({show:"getCurrentShow",getStatus:"getStatus"}),{indexer(){return this.showIndexer||this.$route.query.indexername},id(){return this.showId||Number(this.$route.query.seriesid)||void 0},showLoaded(){return Boolean(this.show.id.slug)},defaultEpisodeStatusOptions(){return 0===this.episodeStatuses.length?[]:["wanted","skipped","ignored"].map(e=>this.getStatus({key:e}))},availableLanguages(){return this.indexers.main.validLanguages?this.indexers.main.validLanguages.join(","):""},combinedQualities(){const{allowed:e,preferred:t}=this.show.config.qualities;return Object(i.c)(e,t)},saveButton(){return!1===this.saving?"Save Changes":"Saving..."},globalIgnored(){return this.$store.state.search.filters.ignored.map(e=>e.toLowerCase())},globalRequired(){return this.$store.state.search.filters.required.map(e=>e.toLowerCase())},effectiveIgnored(){const{globalIgnored:e}=this,t=this.show.config.release.ignoredWords.map(e=>e.toLowerCase());return this.show.config.release.ignoredWordsExclude?Object(i.a)(e,t):Object(i.b)(e.concat(t))},effectiveRequired(){const{globalRequired:e}=this,t=this.show.config.release.requiredWords.map(e=>e.toLowerCase());return this.show.config.release.requiredWordsExclude?Object(i.a)(e,t):Object(i.b)(e.concat(t))}}),created(){this.loadShow()},updated(){e("#config-components").tabs()},methods:u({},Object(o.c)(["getShow","setShow"]),{async loadShow(e){const{$store:t,id:n,indexer:s,getShow:a}=e||this;t.commit("currentShow",{indexer:s,id:n});try{this.loadError=null,await a({indexer:s,id:n,detailed:!1})}catch(e){const{data:t}=e.response;t&&t.error?this.loadError=t.error:this.loadError=String(e)}},async saveShow(e){const{show:t,showLoaded:n}=this;if(!n)return;if(!["show","all"].includes(e))return;this.saving=!0;const s=t.config,a={config:{aliases:s.aliases,defaultEpisodeStatus:s.defaultEpisodeStatus,dvdOrder:s.dvdOrder,seasonFolders:s.seasonFolders,anime:s.anime,scene:s.scene,sports:s.sports,paused:s.paused,location:s.location,airByDate:s.airByDate,subtitlesEnabled:s.subtitlesEnabled,release:{requiredWords:s.release.requiredWords,ignoredWords:s.release.ignoredWords,requiredWordsExclude:s.release.requiredWordsExclude,ignoredWordsExclude:s.release.ignoredWordsExclude},qualities:{preferred:s.qualities.preferred,allowed:s.qualities.allowed},airdateOffset:s.airdateOffset},language:t.language};a.config.anime&&(a.config.release.blacklist=s.release.blacklist,a.config.release.whitelist=s.release.whitelist);const{indexer:o,id:i,setShow:r}=this;try{await r({indexer:o,id:i,data:a}),this.$snotify.success('You may need to "Re-scan files" or "Force Full Update".',"Saved",{timeout:5e3})}catch(e){this.$snotify.error("Error while trying to save ".concat(this.show.title,": ").concat(e.message||"Unknown"),"Error")}finally{this.saving=!1}},onChangeIgnoredWords(e){this.show.config.release.ignoredWords=e.map(e=>e.value)},onChangeRequiredWords(e){this.show.config.release.requiredWords=e.map(e=>e.value)},onChangeAliases(e){this.show.config.aliases=e.map(e=>e.value)},onChangeReleaseGroupsAnime(e){this.show.config.release.whitelist=e.whitelist,this.show.config.release.blacklist=e.blacklist},updateLanguage(e){this.show.language=e}})}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function r(e){for(var t=1;t({layoutOptions:[{value:"compact",text:"Compact"},{value:"detailed",text:"Detailed"}]}),computed:r({},Object(o.e)({config:e=>e.config,stateLayout:e=>e.layout}),{historyLayout:{get(){const{stateLayout:e}=this;return e.history},set(e){const{setLayout:t}=this;t({page:"history",layout:e})}}}),mounted(){const t=this.$watch("stateLayout.history",()=>{t();const{historyLayout:n,config:s}=this;e("#historyTable:has(tbody tr)").tablesorter({widgets:["saveSort","zebra","filter"],sortList:[[0,1]],textExtraction:function(){if("detailed"===n)return{0:t=>e(t).find("time").attr("datetime"),1:t=>e(t).find("a").text(),4:t=>e(t).attr("quality")};const t={0:t=>e(t).find("time").attr("datetime"),1:t=>e(t).find("a").text(),2:t=>void 0===e(t).find("img").attr("title")?"":e(t).find("img").attr("title"),3:t=>e(t).text()};return s.subtitles.enabled?(t[4]=t=>void 0===e(t).find("img").attr("title")?"":e(t).find("img").attr("title"),t[5]=t=>e(t).attr("quality")):t[4]=t=>e(t).attr("quality"),t}(),headers:"detailed"===n?{0:{sorter:"realISODate"}}:{0:{sorter:"realISODate"},2:{sorter:"text"}}})});e("#history_limit").on("change",function(){window.location.href=e("base").attr("href")+"history/?limit="+e(this).val()})},methods:r({},Object(o.c)({setLayout:"setLayout"}))}}).call(this,n(5))},function(e,t,n){"use strict";(function(e){var s=n(4),a=n.n(s),o=n(1),i=n(28),r=n.n(i),l=n(3),c=n(2);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function u(e){for(var t=1;t({layoutOptions:[{value:"poster",text:"Poster"},{value:"small",text:"Small Poster"},{value:"banner",text:"Banner"},{value:"simple",text:"Simple"}],postSortDirOptions:[{value:"0",text:"Descending"},{value:"1",text:"Ascending"}]}),computed:u({},Object(o.e)({config:e=>e.config,stateLayout:e=>e.layout}),{layout:{get(){const{stateLayout:e}=this;return e.home},set(e){const{setLayout:t}=this;t({page:"home",layout:e})}}}),methods:u({},Object(o.c)({setLayout:"setLayout",setConfig:"setConfig"}),{initializePosterSizeSlider(){const t=t=>{let n,s,a,o;t<125?(a=3,o=4):t<175?(n=9,s=40,a=4,o=5):(n=11,s=50,a=6,o=6),e("#posterPopup").remove(),void 0===n?e(".show-details").hide():(e(".show-details").show(),e(".show-dlstats, .show-quality").css("fontSize",n),e(".show-network-image").css("width",s)),e(".show-container").css({width:t,borderWidth:o,borderRadius:a})};let n;"undefined"!=typeof Storage&&(n=parseInt(localStorage.getItem("posterSize"),10)),("number"!=typeof n||isNaN(n))&&(n=188),t(n),e("#posterSizeSlider").slider({min:75,max:250,value:n,change(n,s){"undefined"!=typeof Storage&&localStorage.setItem("posterSize",s.value),t(s.value),e(".show-grid").isotope("layout")}})}}),mounted(){const{config:t,stateLayout:n,setConfig:s}=this;e(document.body).on("click",".resetsorting",()=>{e("table").trigger("filterReset")}),e(document.body).on("input","#filterShowName",r()(()=>{e(".show-grid").isotope({filter(){return e(this).attr("data-name").toLowerCase().includes(e("#filterShowName").val().toLowerCase())}})},500)),e(document.body).on("change","#postersort",function(){e(".show-grid").isotope({sortBy:e(this).val()}),e.get(e(this).find("option[value="+e(this).val()+"]").attr("data-sort"))}),e(document.body).on("change","#postersortdirection",function(){e(".show-grid").isotope({sortAscending:"1"===e(this).val()}),e.get(e(this).find("option[value="+e(this).val()+"]").attr("data-sort"))}),e(document.body).on("change","#showRootDir",function(){l.a.patch("config/main",{selectedRootIndex:parseInt(e(this).val(),10)}).then(e=>{console.info(e),window.location.reload()}).catch(e=>{console.info(e)})});const a=new LazyLoad({threshold:500});window.addEventListener("load",()=>{e("#showTabs").tabs({activate(){e(".show-grid").isotope("layout")}}),e(".progressbar").each(function(){const t=e(this).data("progress-percentage"),n=100===t?100:t>80?80:t>60?60:t>40?40:20;e(this).progressbar({value:t}),e(this).data("progress-text")&&e(this).append('
    '+e(this).data("progress-text")+"
    "),e(this).find(".ui-progressbar-value").addClass("progress-"+n)}),e("img#network").on("error",function(){e(this).parent().text(e(this).attr("alt")),e(this).remove()}),e("#showListTableSeries:has(tbody tr), #showListTableAnime:has(tbody tr)").tablesorter({debug:!1,sortList:[[7,1],[2,0]],textExtraction:{0:t=>e(t).find("time").attr("datetime"),1:t=>e(t).find("time").attr("datetime"),3:t=>e(t).find("span").prop("title").toLowerCase(),4:t=>e(t).find("a[data-indexer-name]").attr("data-indexer-name"),5:t=>e(t).find("span").text().toLowerCase(),6:t=>e(t).find("span:first").text(),7:t=>e(t).data("show-size"),8:t=>e(t).find("img").attr("alt"),10:t=>e(t).find("img").attr("alt")},widgets:["saveSort","zebra","stickyHeaders","filter","columnSelector"],headers:{0:{sorter:"realISODate"},1:{sorter:"realISODate"},2:{sorter:"showNames"},4:{sorter:"text"},5:{sorter:"quality"},6:{sorter:"eps"},7:{sorter:"digit"},8:{filter:"parsed"},10:{filter:"parsed"}},widgetOptions:{filter_columnFilters:!0,filter_hideFilters:!0,filter_saveFilters:!0,filter_functions:{5(e,t,n){let s=!1;const a=Math.floor(t%1*1e3);if(""===n)s=!0;else{let e=n.match(/(<|<=|>=|>)\s+(\d+)/i);e&&("<"===e[1]?a="===e[1]?a>=parseInt(e[2],10)&&(s=!0):">"===e[1]&&a>parseInt(e[2],10)&&(s=!0)),(e=n.match(/(\d+)\s(-|to)\s+(\d+)/i))&&("-"!==e[2]&&"to"!==e[2]||a>=parseInt(e[1],10)&&a<=parseInt(e[3],10)&&(s=!0)),(e=n.match(/(=)?\s?(\d+)\s?(=)?/i))&&("="!==e[1]&&"="!==e[3]||parseInt(e[2],10)===a&&(s=!0)),!isNaN(parseFloat(n))&&isFinite(n)&&parseInt(n,10)===a&&(s=!0)}return s}},columnSelector_mediaquery:!1},sortStable:!0,sortAppend:[[2,0]]}).bind("sortEnd",()=>{a.handleScroll()}).bind("filterEnd",()=>{a.handleScroll()}),e(".show-grid").imagesLoaded(()=>{this.initializePosterSizeSlider(),e(".loading-spinner").hide(),e(".show-grid").show().isotope({itemSelector:".show-container",sortBy:n.posterSortby,sortAscending:n.posterSortdir,layoutMode:"masonry",masonry:{isFitWidth:!0},getSortData:{name(t){const s=e(t).attr("data-name")||"";return(n.sortArticle?s:s.replace(/^((?:The|A|An)\s)/i,"")).toLowerCase()},network:"[data-network]",date(t){const n=e(t).attr("data-date");return n.length&&parseInt(n,10)||Number.POSITIVE_INFINITY},progress(t){const n=e(t).attr("data-progress");return n.length&&parseInt(n,10)||Number.NEGATIVE_INFINITY},indexer(t){const n=e(t).attr("data-indexer");return void 0===n?Number.NEGATIVE_INFINITY:n.length&&parseInt(n,10)||Number.NEGATIVE_INFINITY}}}).on("layoutComplete arrangeComplete removeComplete",()=>{a.update(),a.handleScroll()});let t=null;e(".show-container").on("mouseenter",function(){const n=e(this);"none"===n.find(".show-details").css("display")&&(t=setTimeout(()=>{t=null,e("#posterPopup").remove();const s=n.clone().attr({id:"posterPopup"}),a=n.offset().left,o=n.offset().top;s.css({position:"absolute",margin:0,top:o,left:a}),s.find(".show-details").show(),s.on("mouseleave",function(){e(this).remove()}),s.css({zIndex:"9999"}),s.appendTo("body");let i=o+n.height()/2-219,r=a+n.width()/2-125;const l=e(window).scrollTop(),c=e(window).scrollLeft(),d=l+e(window).innerHeight(),u=c+e(window).innerWidth();id&&(i=d-438-5),r+250+5>u&&(r=u-250-5),s.animate({top:i,left:r,width:250,height:438})},300))}).on("mouseleave",()=>{null!==t&&clearTimeout(t)}),a.update(),a.handleScroll()}),e("#popover").popover({placement:"bottom",html:!0,content:'
    '}).on("shown.bs.popover",()=>{e.tablesorter.columnSelector.attachTo(e("#showListTableSeries"),"#popover-target"),n.animeSplitHome&&e.tablesorter.columnSelector.attachTo(e("#showListTableAnime"),"#popover-target")});const o=t.rootDirs,i=t.selectedRootIndex;if(o){const t=o.slice(1);if(t.length>=2){e("#showRoot").show();const n=["All Folders"].concat(t);e.each(n,(t,n)=>{e("#showRootDir").append(e("