diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index a1f55bf54a..a8b058495a 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,6 +1,6 @@
### Questions about SickChill?
-To get your questions answered, please ask on the [#sickchill](http://webchat.freenode.net/?channels=sickchill) IRC channel on irc.freenode.net
+To get your questions answered, please ask on the [sickchill discord](https://discord.gg/FXre9qkHwE)
# Contributing to SickChill
@@ -17,9 +17,7 @@ The goal of this guide is to provide the best way to contribute to the official
## Discussion
-If you think you've found a bug please [file it in the bug tracker](#how-to-report-bugs).
-
-Most of the SickChill development team can be found in the [#sickchill](http://webchat.freenode.net/?channels=sickchill) IRC channel on irc.freenode.net.
+If you think you've found a bug please report it on [discord](https://discord.gg/FXre9qkHwE), where you will find most of the sickchill dev team.
## How to Report Bugs
@@ -28,7 +26,7 @@ Most of the SickChill development team can be found in the [#sickchill](http://w
Many bugs reported are actually issues with the user mis-understanding of how something works (there are a bit of moving parts to an ideal setup) and most of the time can be fixed by just changing some settings to fit the users needs.
-If you are new to SickChill, it is usually a much better idea to ask for help first in the [SickChill IRC channel](http://webchat.freenode.net/?channels=sickchill). You will get much quicker support, and you will help avoid tying up the SickChill team with invalid bug reports.
+If you are new to SickChill, it is usually a much better idea to ask for help first in the [sickchill discord](https://discord.gg/FXre9qkHwE). You will get much quicker support, and you will help avoid tying up the SickChill team with invalid bug reports.
### Try the latest version of SickChill
diff --git a/.snyk b/.snyk
index 2394d030e7..573c35dd21 100644
--- a/.snyk
+++ b/.snyk
@@ -1,15 +1,3 @@
-ignore:
- 'npm:semver:20150403':
- - semver@2.3.2:
- reason: Waiting for official update
- expires: '2015-12-21T06:00:27.961Z'
- 'npm:uglify-js:20150824':
- - uglify-js@2.3.6:
- reason: Waiting for official update
- expires: '2015-12-21T06:00:27.962Z'
- 'npm:uglify-js:20151024':
- - uglify-js@2.3.6:
- reason: Waiting for official update
- expires: '2015-12-21T06:00:27.962Z'
+ignore: {}
patch: {}
version: v1
diff --git a/package.json b/package.json
index 5d1d7c5079..05eba6e02b 100644
--- a/package.json
+++ b/package.json
@@ -20,17 +20,17 @@
"serve": "webpack serve"
},
"devDependencies": {
- "@babel/core": "^7.23.7",
- "@babel/preset-env": "^7.23.7",
- "@popperjs/core": "^2.11.6",
- "@webpack-cli/generators": "^3.0.0",
- "ava": "^6.0.1",
- "babel-loader": "^9.0.0",
- "bootstrap": "^5.3.1",
- "bower": "^1.8.13",
- "browser-env": "^3.1.0",
- "copy-webpack-plugin": "^12.0.1",
- "css-loader": "^6.7.1",
+ "@babel/core": "^7.23.9",
+ "@babel/preset-env": "^7.23.9",
+ "@popperjs/core": "^2.11.8",
+ "@webpack-cli/generators": "^3.0.7",
+ "ava": "^6.1.1",
+ "babel-loader": "^9.1.3",
+ "bootstrap": "^5.3.2",
+ "bower": "^1.8.14",
+ "browser-env": "^3.3.0",
+ "copy-webpack-plugin": "^12.0.2",
+ "css-loader": "^6.10.0",
"eslint": "^8.56.0",
"eslint-config-xo": "^0.44.0",
"eslint-plugin-ava": "^14.0.0",
@@ -38,41 +38,42 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-node": "^11.1.0",
- "eslint-plugin-promise": "^6.0.0",
+ "eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^51.0.1",
- "grunt": "^1.5.2",
+ "grunt": "^1.6.1",
"grunt-bower-concat": "git+https://github.com/miigotu/grunt-bower-concat.git",
- "grunt-bower-task": "^0.6.1",
- "grunt-cli": "^1.2.0",
- "grunt-contrib-clean": "^2.0.0",
+ "grunt-bower-task": "^0.6.2",
+ "grunt-cli": "^1.4.3",
+ "grunt-contrib-clean": "^2.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^5.0.0",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-sass": "^2.0.0",
- "grunt-contrib-uglify": "^5.2.1",
- "grunt-contrib-watch": "^1.0.0",
+ "grunt-contrib-uglify": "^5.2.2",
+ "grunt-contrib-watch": "^1.1.0",
"grunt-exec": "^3.0.0",
"grunt-po2json": "git+https://github.com/rockykitamura/grunt-po2json.git",
"html-webpack-plugin": "^5.6.0",
- "jquery": "^3.2.1",
+ "jquery": "^3.7.1",
"load-grunt-tasks": "^5.1.0",
- "lodash": "^4.17.15",
+ "lodash": "^4.17.21",
"mem-fs": "^4.0.0",
"mem-fs-editor": "^11.0.0",
- "mini-css-extract-plugin": "^2.6.1",
- "sass": "^1.69.7",
- "sass-loader": "^14.0.0",
- "snyk": "^1.1266.0",
- "style-loader": "^3.3.1",
- "stylelint": "^16.1.0",
+ "mini-css-extract-plugin": "^2.8.0",
+ "sass": "^1.71.0",
+ "sass-loader": "^14.1.0",
+ "snyk": "^1.1280.0",
+ "style-loader": "^3.3.4",
+ "stylelint": "^16.2.1",
"stylelint-config-idiomatic-order": "^10.0.0",
"toml": "^3.0.0",
- "webpack": "^5.76.0",
- "webpack-cli": "^5.0.0",
- "webpack-dev-server": "^4.11.1",
+ "webpack": "^5.90.2",
+ "webpack-cli": "^5.1.4",
+ "webpack-dev-server": "^5.0.2",
"workbox-webpack-plugin": "^7.0.0",
"xo": "^0.57.0",
- "yarn-minify": "^1.0.1"
+ "yarn-minify": "^1.0.1",
+ "yarn-upgrade-all": "^0.7.2"
},
"ava": {
"require": [
diff --git a/pyproject.toml b/pyproject.toml
index 2b3638e0fe..4e8b1bc987 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,6 @@ packages = [
"Bug Tracker" = "https://github.com/sickchill/sickchill/issues"
"News" = "https://raw.githubusercontent.com/SickChill/sickchill.github.io/master/sickchill-news/news.md"
"Discord" = "https://discord.com/invite/U8WPBdf"
-"IRC" = "https://webchat.freenode.net/?channels=#sickchill"
"Donate"= "https://github.com/SickChill/SickChill/wiki/Donations"
[tool.poetry.scripts]
@@ -259,7 +258,6 @@ ipaddress = "^1.0.23"
jsonrpclib-pelix = "^0.4.2"
Mako = "^1.1.4"
markdown2 = "^2.4.0"
-PyGithub = ">=1.54.1,<3.0.0"
pyOpenSSL = ">=20.0.1,<25.0.0"
python-dateutil = "^2.8.1"
python-twitter = "^3.5"
diff --git a/sickchill/gui/slick/css/style.css b/sickchill/gui/slick/css/style.css
index f077ffcf28..c4af2c07b6 100644
--- a/sickchill/gui/slick/css/style.css
+++ b/sickchill/gui/slick/css/style.css
@@ -318,10 +318,6 @@ inc_top.mako
background-position: -456px 0;
}
-.menu-icon-irc {
- background-position: -478px 0;
-}
-
.menu-icon-changelog {
background-position: -495px 0;
}
@@ -1936,10 +1932,6 @@ select .selected {
background-position: -452px 0;
}
-.add-client-icon-irc {
- background-position: -488px 0;
-}
-
.add-client-icon-putio {
background-position: -517px 0;
}
diff --git a/sickchill/gui/slick/js/core.js b/sickchill/gui/slick/js/core.js
index 84aea51572..124cc0e0bc 100644
--- a/sickchill/gui/slick/js/core.js
+++ b/sickchill/gui/slick/js/core.js
@@ -369,21 +369,6 @@ const SICKCHILL = {
}
});
});
-
- $('#git_token').on('click', $('#git_token').select());
-
- $('#create_access_token').on('click', () => {
- notifyModal(
- '
Copy the generated token and paste it in the token input box.
'
- + '
Provide permissions for repo:status, public_repo, write:discussion, read:discussion, user, gist, and notifications
');
- $('#git_token').select();
- });
-
- $('#manage_tokens').on('click', () => {
- window.open(anonURL + 'https://github.com/settings/tokens', '_blank');
- });
},
index() {
$('#log_dir').fileBrowser({title: _('Select log file folder location')});
diff --git a/sickchill/gui/slick/js/core.min.js b/sickchill/gui/slick/js/core.min.js
index 129e845f31..ba33917fe5 100644
--- a/sickchill/gui/slick/js/core.min.js
+++ b/sickchill/gui/slick/js/core.min.js
@@ -1 +1 @@
-function getMeta(e){return $('meta[data-var="'+e+'"]').data("content")}const scRoot=getMeta("scRoot"),scDefaultPage=getMeta("scDefaultPage"),themeSpinner=getMeta("themeSpinner"),anonURL=getMeta("anonURL"),topImageHtml='',loading='';let scPID=getMeta("scPID");function configSuccess(e=!0){$(".config_submitter").each(function(){$(this).removeAttr("disabled"),$(this).next().remove(),$(this).show(),!0===e&&window.location.reload()}),$(".config_submitter_refresh").each(function(){$(this).removeAttr("disabled"),$(this).next().remove(),$(this).show()}),$("#email_show").trigger("notify"),$("#prowl_show").trigger("notify")}function metaToBool(e){let t=$('meta[data-var="'+e+'"]').data("content");return void 0===t?(console.log(e+' is empty, did you forget to add this to "main.mako"?'),t):!("false"===(t=(t=Number.isNaN(t)?t.toLowerCase():t.toString()).toLowerCase())||"none"===t||"0"===t)}function isMeta(e,t){return new RegExp(1{var t=$("#site-messages");if(void 0!==t){t.empty();for(const o in e)Object.hasOwn(e,o)&&t.append('
'+e[o].message+'
')}}),$("#site-messages").on("click",".site-message-dismiss",function(){var e=$(this).data("id");$("#site-message-"+e).hide(),$.post(scRoot+"/ui/dismiss-site-message",{index:e})})}function shiftReturn(e){return e.length<=1?[]:(e.shift(),e)}const __=_,SICKCHILL=(window._=function(e){return e},{common:{init(){for(const e of document.querySelectorAll("img"))e.dataset.src&&e.setAttribute("src",e.dataset.src);metaToBool("settings.SICKCHILL_BACKGROUND")&&($.backstretch(scRoot+"/ui/sickchill_background"),$(".backstretch").css("opacity",getMeta("settings.FANART_BACKGROUND_OPACITY")).fadeIn("500")),addSiteMessage(),$.confirm.options={confirmButton:"Yes",cancelButton:"Cancel",dialogClass:"modal-dialog",post:!1,confirm(e){location.href=e.context.href}},$("a.shutdown").confirm({title:"Shutdown",text:"Are you sure you want to shut down SickChill?"}),$("a.restart").confirm({title:"Restart",text:"Are you sure you want to restart SickChill?"}),$("a.removeshow").confirm({title:"Remove Show",text:'Are you sure you want to remove '+$("#showtitle").data("showname")+' from the database?
',confirm(e){location.href=e.context.href+($("#deleteFiles")[0].checked?"&full=1":"&full=0")}}),$("a.clearhistory").confirm({title:"Clear History",text:"Are you sure you want to clear all download history?"}),$("a.trimhistory").confirm({title:"Trim History",text:"Are you sure you want to trim all download history older than 30 days?"}),$("a.submiterrors").confirm({title:"Submit Errors",text:'Are you sure you want to submit these errors ?
Make sure SickChill is updated and trigger this error with debug enabled before submitting'}),$("#config-components").tabs({activate(e,t){var o=$(this).data("lastOpenedPanel");o||=$(t.oldPanel),$(this).data("topPositionTab")||$(this).data("topPositionTab",$(t.newPanel).position().top),$(t.newPanel).hide().fadeIn(0),o&&o.toggleClass("ui-tabs-hide").css("position","absolute").css("top",$(this).data("topPositionTab")+"px").fadeOut(0,function(){$(this).css("position","")}),$(this).data("lastOpenedPanel",$(t.newPanel))}}),(navigator.maxTouchPoints||0)<2&&$(".dropdown-toggle").on("click",function(){var e=$(this);"true"===e.prop("ariaExpanded")&&(window.location.href=e.prop("href"))}),metaToBool("settings.FUZZY_DATING")&&($.timeago.settings.allowFuture=!0,$.timeago.settings.strings={prefixAgo:null,prefixFromNow:"In ",suffixAgo:"ago",suffixFromNow:"",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"an hour",hours:"%d hours",day:"a day",days:"%d days",month:"a month",months:"%d months",year:"a year",years:"%d years",wordSeparator:" ",numbers:[]},$("[datetime]").timeago()),$(document.body).on("click","a[data-no-redirect]",e=>(e.preventDefault(),$.get($(e.currentTarget).prop("href")),!1)),$(document.body).on("change",".bulkCheck",e=>{const t=e.currentTarget;e="."+t.id+":visible";$(e).each(function(){this.checked=t.checked})}),$(".enabler").on("change",function(){this.checked?$("#content_"+$(this).attr("id")).fadeIn("fast","linear"):$("#content_"+$(this).attr("id")).fadeOut("fast","linear")})},QualityChooser:{setFromPresets(t){0===Number.parseInt(t,10)?$("#customQuality").show():($("#customQuality").hide(),$("#anyQualities").find("option").each(function(){var e=t&$(this).val();$(this).attr("selected",0{this.setFromPresets(e.find(":selected").val())}),this.setFromPresets(e.find(":selected").val())}},updateBlackWhiteList(e){$("#pool").children().remove(),$("#anime").is(":checked")?($("#blackwhitelist").show(),e&&$.getJSON(scRoot+"/home/fetch_releasegroups",{show_name:e},e=>{"success"===e.result&&$.each(e.groups,(e,t)=>{var o=$(""):$("#pushbullet_device_list").append('"));$("#pushbullet_device_list").prepend('"),t&&$("#testPushbullet-result").html(t)}),$("#pushbullet_device_list").on("change",()=>{$("#pushbullet_device").val($("#pushbullet_device_list").val()),$("#testPushbullet-result").html(_("Don't forget to save your new pushbullet settings."))}),$.post(scRoot+"/home/getPushbulletChannels",{api:o.api},e=>{if(o.channels=$.parseJSON(e).channels,o.currentChannel=$("#pushbullet_channel").val(),$("#pushbullet_channel_list").html(""),0'+o.channels[e].name+""):$("#pushbullet_channel_list").append('");$("#pushbullet_channel_list").prepend('"),$("#pushbullet_channel_list").prop("disabled",!1)}else $("#pushbullet_channel_list").prepend(''),$("#pushbullet_channel_list").prop("disabled",!0);t&&$("#testPushbullet-result").html(t),$("#pushbullet_channel_list").on("change",()=>{$("#pushbullet_channel").val($("#pushbullet_channel_list").val()),$("#testPushbullet-result").html(_("Don't forget to save your new pushbullet settings."))})})):($("#testPushbullet-result").html(_("You didn't supply a Pushbullet api key")),$("#pushbullet_api").focus())}function t(){$.getJSON(scRoot+"/home/loadShowNotifyLists",t=>{if(0!==t._size){var o=[];for(const a in t)Object.hasOwn(t,a)&&"_"!==a.charAt(0)&&o.push(t[a]);var s=o.sort((e,t)=>e.namet.name?1:0);let e='';for(const i in s)Object.hasOwn(s,i)&&s[i].id&&s[i].name&&(e+='"):$("#pushbullet_channel_list").append('
'),$("#pushbullet_channel_list").prop("disabled",!0);t&&$("#testPushbullet-result").html(t),$("#pushbullet_channel_list").on("change",()=>{$("#pushbullet_channel").val($("#pushbullet_channel_list").val()),$("#testPushbullet-result").html(_("Don't forget to save your new pushbullet settings."))})})):($("#testPushbullet-result").html(_("You didn't supply a Pushbullet api key")),$("#pushbullet_api").focus())}function t(){$.getJSON(scRoot+"/home/loadShowNotifyLists",t=>{if(0!==t._size){var o=[];for(const a in t)Object.hasOwn(t,a)&&"_"!==a.charAt(0)&&o.push(t[a]);var s=o.sort((e,t)=>e.namet.name?1:0);let e='
-- Select --
';for(const i in s)Object.hasOwn(s,i)&&s[i].id&&s[i].name&&(e+='
'+$("
").text(s[i].name).html()+"");$("#email_show").html(e),$("#email_show_list").val(""),$("#prowl_show").html(e),$("#prowl_show_list").val("")}})}$("#testGrowl").on("click",function(){var e={};e.host=$.trim($("#growl_host").val()),e.password=$.trim($("#growl_password").val()),e.host?($("#growl_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testGrowl-result").html(loading),$.get(scRoot+"/home/testGrowl",{host:e.host,password:e.password}).done(e=>{$("#testGrowl-result").html(e),$("#testGrowl").prop("disabled",!1)})):($("#testGrowl-result").html(_("Please fill out the necessary fields above.")),$("#growl_host").addClass("warning"))}),$("#testProwl").on("click",function(){var e={};e.api=$.trim($("#prowl_api").val()),e.priority=$("#prowl_priority").val(),e.api?($("#prowl_api").removeClass("warning"),$(this).prop("disabled",!0),$("#testProwl-result").html(loading),$.get(scRoot+"/home/testProwl",{prowl_api:e.api,prowl_priority:e.priority}).done(e=>{$("#testProwl-result").html(e),$("#testProwl").prop("disabled",!1)})):($("#testProwl-result").html(_("Please fill out the necessary fields above.")),$("#prowl_api").addClass("warning"))}),$("#testKODI").on("click",function(){var e={};e.host=$.trim($("#kodi_host").val()),e.username=$.trim($("#kodi_username").val()),e.password=$.trim($("#kodi_password").val()),e.host?($("#kodi_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testKODI-result").html(loading),$.get(scRoot+"/home/testKODI",{host:e.host,username:e.username,password:e.password}).done(e=>{$("#testKODI-result").html(e),$("#testKODI").prop("disabled",!1)})):($("#testKODI-result").html(_("Please fill out the necessary fields above.")),$("#kodi_host").addClass("warning"))}),$("#testPHT").on("click",function(){var e={client:{}};e.client.host=$.trim($("#plex_client_host").val()),e.client.username=$.trim($("#plex_client_username").val()),e.client.password=$.trim($("#plex_client_password").val()),e.client.host?($("#plex_client_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testPHT-result").html(loading),$.get(scRoot+"/home/testPHT",{host:e.client.host,username:e.client.username,password:e.client.password}).done(e=>{$("#testPHT-result").html(e),$("#testPHT").prop("disabled",!1)})):($("#testPHT-result").html(_("Please fill out the necessary fields above.")),$("#plex_client_host").addClass("warning"))}),$("#testPMS").on("click",function(){var e={server:{}};e.server.host=$.trim($("#plex_server_host").val()),e.server.username=$.trim($("#plex_server_username").val()),e.server.password=$.trim($("#plex_server_password").val()),e.server.token=$.trim($("#plex_server_token").val()),e.server.host?($("#plex_server_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testPMS-result").html(loading),$.get(scRoot+"/home/testPMS",{host:e.server.host,username:e.server.username,password:e.server.password,plex_server_token:e.server.token}).done(e=>{$("#testPMS-result").html(e),$("#testPMS").prop("disabled",!1)})):($("#testPMS-result").html(_("Please fill out the necessary fields above.")),$("#plex_server_host").addClass("warning"))}),$("#testEMBY").on("click",function(){var e={};e.host=$("#emby_host").val(),e.apikey=$("#emby_apikey").val(),e.host&&e.apikey?($("#emby_host,#emby_apikey").removeClass("warning"),$(this).prop("disabled",!0),$("#testEMBY-result").html(loading),$.get(scRoot+"/home/testEMBY",{host:e.host,emby_apikey:e.apikey}).done(e=>{$("#testEMBY-result").html(e),$("#testEMBY").prop("disabled",!1)})):($("#testEMBY-result").html(_("Please fill out the necessary fields above.")),e.host?$("#emby_host").removeClass("warning"):$("#emby_host").addClass("warning"),e.apikey?$("#emby_apikey").removeClass("warning"):$("#emby_apikey").addClass("warning"))}),$("#testBoxcar2").on("click",function(){var e={};e.accesstoken=$.trim($("#boxcar2_accesstoken").val()),e.accesstoken?($("#boxcar2_accesstoken").removeClass("warning"),$(this).prop("disabled",!0),$("#testBoxcar2-result").html(loading),$.get(scRoot+"/home/testBoxcar2",{accesstoken:e.accesstoken}).done(e=>{$("#testBoxcar2-result").html(e),$("#testBoxcar2").prop("disabled",!1)})):($("#testBoxcar2-result").html(_("Please fill out the necessary fields above.")),$("#boxcar2_accesstoken").addClass("warning"))}),$("#testPushover").on("click",function(){var e={};e.userkey=$("#pushover_userkey").val(),e.apikey=$("#pushover_apikey").val(),e.userkey&&e.apikey?($("#pushover_userkey,#pushover_apikey").removeClass("warning"),$(this).prop("disabled",!0),$("#testPushover-result").html(loading),$.get(scRoot+"/home/testPushover",{userKey:e.userkey,apiKey:e.apikey}).done(e=>{$("#testPushover-result").html(e),$("#testPushover").prop("disabled",!1)})):($("#testPushover-result").html(_("Please fill out the necessary fields above.")),e.userkey?$("#pushover_userkey").removeClass("warning"):$("#pushover_userkey").addClass("warning"),e.apikey?$("#pushover_apikey").removeClass("warning"):$("#pushover_apikey").addClass("warning"))}),$("#testLibnotify").on("click",()=>{$("#testLibnotify-result").html(loading),$.get(scRoot+"/home/testLibnotify",e=>{$("#testLibnotify-result").html(e)})}),$("#twitterStep1").on("click",()=>{$("#testTwitter-result").html(loading),$.get(scRoot+"/home/twitterStep1",e=>{window.open(e)}).done(()=>{$("#testTwitter-result").html(_("Step 1: Confirm Authorization"))})}),$("#twitterStep2").on("click",()=>{var e={};e.key=$.trim($("#twitter_key").val()),e.key?($("#twitter_key").removeClass("warning"),$("#testTwitter-result").html(loading),$.get(scRoot+"/home/twitterStep2",{key:e.key},e=>{$("#testTwitter-result").html(e)})):($("#testTwitter-result").html(_("Please fill out the necessary fields above.")),$("#twitter_key").addClass("warning"))}),$("#testTwitter").on("click",()=>{$.post(scRoot+"/home/testTwitter",e=>{$("#testTwitter-result").html(e)})}),$("#testTwilio").on("click",()=>{$("#testTwilio").addClass("disabled"),$.post(scRoot+"/home/testTwilio",e=>{$("#testTwilio-result").html(e)}).always(()=>{$("#testTwilio").removeClass("disabled")})}),$("#testSlack").on("click",()=>{$.post(scRoot+"/home/testSlack",e=>{$("#testSlack-result").html(e)})}),$("#testMattermost").on("click",()=>{$.post(scRoot+"/home/testMattermost",e=>{$("#testMattermost-result").html(e)})}),$("#testMattermostBot").on("click",()=>{$.post(scRoot+"/home/testMattermostBot",e=>{$("#testMattermostBot-result").html(e)})}),$("#testRocketChat").on("click",()=>{$.post(scRoot+"/home/testRocketChat",e=>{$("#testRocketChat-result").html(e)})}),$("#testMatrix").on("click",()=>{$.post(scRoot+"/home/testMatrix",e=>{$("#testMatrix-result").html(e)})}),$("#testDiscord").on("click",()=>{var e,t=$("#discord_webhook");t.val()?(e={webhook:t.val(),name:$("#discord_name").val(),avatar:$("#discord_avatar_url").val(),tts:$("#discord_tts").is(":checked")?1:0},$("#testDiscord").prop("disabled",!0),$("#testDiscord-result").html(loading),$.post(scRoot+"/home/testDiscord",e).done(e=>{$("#testDiscord-result").html(e),$("#testDiscord").prop("disabled",!1)})):(t.focus(),notifyModal("Please fill in the webhook address"))}),$("#settingsNMJ").on("click",()=>{var e={};$("#nmj_host").val()?($("#testNMJ-result").html(loading),e.host=$("#nmj_host").val(),$.post(scRoot+"/home/settingsNMJ",{host:e.host},e=>{null===e&&($("#nmj_database").removeAttr("readonly"),$("#nmj_mount").removeAttr("readonly"));e=$.parseJSON(e);$("#testNMJ-result").html(e.message),$("#nmj_database").val(e.database),$("#nmj_mount").val(e.mount),e.database?$("#nmj_database").attr("readonly",!0):$("#nmj_database").removeAttr("readonly"),e.mount?$("#nmj_mount").attr("readonly",!0):$("#nmj_mount").removeAttr("readonly")})):($("#nmj_host").focus(),notifyModal("Please fill in the Popcorn IP address"))}),$("#testNMJ").on("click",function(){var e={};e.host=$.trim($("#nmj_host").val()),e.database=$("#nmj_database").val(),e.mount=$("#nmj_mount").val(),e.host?($("#nmj_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testNMJ-result").html(loading),$.post(scRoot+"/home/testNMJ",{host:e.host,database:e.database,mount:e.mount}).done(e=>{$("#testNMJ-result").html(e),$("#testNMJ").prop("disabled",!1)})):($("#testNMJ-result").html(_("Please fill out the necessary fields above.")),$("#nmj_host").addClass("warning"))}),$("#settingsNMJv2").on("click",()=>{var e={};if($("#nmjv2_host").val()){$("#testNMJv2-result").html(loading),e.host=$("#nmjv2_host").val(),e.dbloc="";for(const t of document.getElementsByName("nmjv2_dbloc"))if(t.checked){e.dbloc=t.value;break}e.dbinstance=$("#NMJv2db_instance").val(),$.post(scRoot+"/home/settingsNMJv2",{host:e.host,dbloc:e.dbloc,instance:e.dbinstance},e=>{null===e&&$("#nmjv2_database").removeAttr("readonly");e=$.parseJSON(e);$("#testNMJv2-result").html(e.message),$("#nmjv2_database").val(e.database),e.database?$("#nmjv2_database").attr("readonly",!0):$("#nmjv2_database").removeAttr("readonly")})}else $("#nmjv2_host").focus(),notifyModal("Please fill in the Popcorn IP address","modal")}),$("#testNMJv2").on("click",function(){var e={};e.host=$.trim($("#nmjv2_host").val()),e.host?($("#nmjv2_host").removeClass("warning"),$(this).prop("disabled",!0),$("#testNMJv2-result").html(loading),$.post(scRoot+"/home/testNMJv2",{host:e.host}).done(e=>{$("#testNMJv2-result").html(e),$("#testNMJv2").prop("disabled",!1)})):($("#testNMJv2-result").html(_("Please fill out the necessary fields above.")),$("#nmjv2_host").addClass("warning"))}),$("#testFreeMobile").on("click",function(){var e={};e.id=$.trim($("#freemobile_id").val()),e.apikey=$.trim($("#freemobile_apikey").val()),e.id&&e.apikey?($("#freemobile_id,#freemobile_apikey").removeClass("warning"),$(this).prop("disabled",!0),$("#testFreeMobile-result").html(loading),$.post(scRoot+"/home/testFreeMobile",{freemobile_id:e.id,freemobile_apikey:e.apikey}).done(e=>{$("#testFreeMobile-result").html(e),$("#testFreeMobile").prop("disabled",!1)})):($("#testFreeMobile-result").html(_("Please fill out the necessary fields above.")),e.id?$("#freemobile_id").removeClass("warning"):$("#freemobile_id").addClass("warning"),e.apikey?$("#freemobile_apikey").removeClass("warning"):$("#freemobile_apikey").addClass("warning"))}),$("#testTelegram").on("click",function(){var e={};e.id=$.trim($("#telegram_id").val()),e.apikey=$.trim($("#telegram_apikey").val()),e.id&&e.apikey?($("#telegram_id,#telegram_apikey").removeClass("warning"),$(this).prop("disabled",!0),$("#testTelegram-result").html(loading),$.post(scRoot+"/home/testTelegram",{telegram_id:e.id,telegram_apikey:e.apikey}).done(e=>{$("#testTelegram-result").html(e),$("#testTelegram").prop("disabled",!1)})):($("#testTelegram-result").html(_("Please fill out the necessary fields above.")),e.id?$("#telegram_id").removeClass("warning"):$("#telegram_id").addClass("warning"),e.apikey?$("#telegram_apikey").removeClass("warning"):$("#telegram_apikey").addClass("warning"))}),$("#testJoin").on("click",function(){var e={};e.id=$.trim($("#join_id").val()),e.apikey=$.trim($("#join_apikey").val()),e.id&&e.apikey?($("#join_id,#join_apikey").removeClass("warning"),$(this).prop("disabled",!0),$("#testJoin-result").html(loading),$.post(scRoot+"/home/testJoin",{join_id:e.id,join_apikey:e.apikey}).done(e=>{$("#testJoin-result").html(e),$("#testJoin").prop("disabled",!1)})):($("#testJoin-result").html(_("Please fill out the necessary fields above.")),e.id?$("#join_id").removeClass("warning"):$("#join_id").addClass("warning"),e.apikey?$("#join_apikey").removeClass("warning"):$("#join_apikey").addClass("warning"))}),$("#TraktGetPin").on("click",()=>{window.open($("#trakt_pin_url").val(),"popUp","toolbar=no, scrollbars=no, resizable=no, top=200, left=200, width=650, height=550"),$("#trakt_pin").removeClass("hide")}),$("#trakt_pin").on("keyup change",()=>{0===$("#trakt_pin").val().length?($("#TraktGetPin").removeClass("hide"),$("#authTrakt").addClass("hide")):($("#TraktGetPin").addClass("hide"),$("#authTrakt").removeClass("hide"))}),$("#authTrakt").on("click",()=>{var e={};e.pin=$("#trakt_pin").val(),0{$("#testTrakt-result").html(e),$("#authTrakt").addClass("hide"),$("#trakt_pin").addClass("hide"),$("#TraktGetPin").addClass("hide")})}),$("#testTrakt").on("click",function(){var e={};e.username=$.trim($("#trakt_username").val()),e.trendingBlacklist=$.trim($("#trakt_blacklist_name").val()),e.username?/\s/g.test(e.trendingBlacklist)?($("#testTrakt-result").html(_("Check blacklist name; the value needs to be a trakt slug")),$("#trakt_blacklist_name").addClass("warning")):($("#trakt_username").removeClass("warning"),$("#trakt_blacklist_name").removeClass("warning"),$(this).prop("disabled",!0),$("#testTrakt-result").html(loading),$.post(scRoot+"/home/testTrakt",{username:e.username,blacklist_name:e.trendingBlacklist}).done(e=>{$("#testTrakt-result").html(e),$("#testTrakt").prop("disabled",!1)})):($("#testTrakt-result").html(_("Please fill out the necessary fields above.")),e.username?$("#trakt_username").removeClass("warning"):$("#trakt_username").addClass("warning"))}),$("#testEmail").on("click",()=>{var e=$("#testEmail-result"),t=(e.html(loading),0<$("#email_host").val().length?$("#email_host").val():null),o=0<$("#email_port").val().length?$("#email_port").val():null,s=$("#email_tls").is(":checked")?1:0,a=0<$("#email_from").val().length?$("#email_from").val():"root@localhost",i=$("#email_user").val().trim(),n=$("#email_password").val();let r="";var l="";null===t&&(r+='
You must specify an SMTP hostname!
'),null===o?r+='
You must specify an SMTP port!
':(null===o.match(/^\d+$/)||65535SMTP port must be between 0 and 65535!'),0"+r+"",e.html(r)):null===(l=prompt("Enter an email address to send the test to:",null))||0===l.length||null===l.match(/.*@.*/)?e.html('
'+_("You must provide a recipient email address!")+"
"):$.post(scRoot+"/home/testEmail",{host:t,port:o,smtp_from:a,use_tls:s,user:i,pwd:n,to:l},e=>{$("#testEmail-result").html(e)})}),$("#testPushalot").on("click",function(){var e={};e.authToken=$.trim($("#pushalot_authorizationtoken").val()),e.authToken?($("#pushalot_authorizationtoken").removeClass("warning"),$(this).prop("disabled",!0),$("#testPushalot-result").html(loading),$.post(scRoot+"/home/testPushalot",{authorizationToken:e.authToken}).done(e=>{$("#testPushalot-result").html(e),$("#testPushalot").prop("disabled",!1)})):($("#testPushalot-result").html(_("Please fill out the necessary fields above.")),$("#pushalot_authorizationtoken").addClass("warning"))}),$("#testGotify").on("click",function(){var e={};e.host=$.trim($("#gotify_host").val()),e.authToken=$.trim($("#gotify_authorizationtoken").val()),e.host&&e.authToken?($("#gotify_host,#gotify_authorizationtoken").removeClass("warning"),$(this).prop("disabled",!0),$("#testGotify-result").html(loading),$.post(scRoot+"/home/testGotify",{host:e.host,authorizationToken:e.authToken}).done(e=>{$("#testGotify-result").html(e),$("#testGotify").prop("disabled",!1)})):($("#testGotify-result").html(_("Please fill out the necessary fields above.")),e.host?$("#gotify_host").removeClass("warning"):$("#gotify_host").addClass("warning"),e.authToken?$("#gotify_authorizationtoken").removeClass("warning"):$("#gotify_authorizationtoken").addClass("warning"))}),$("#testPushbullet").on("click",function(){var e={};e.api=$.trim($("#pushbullet_api").val()),e.api?($("#pushbullet_api").removeClass("warning"),$(this).prop("disabled",!0),$("#testPushbullet-result").html(loading),$.post(scRoot+"/home/testPushbullet",{api:e.api}).done(e=>{$("#testPushbullet-result").html(e),$("#testPushbullet").prop("disabled",!1)})):($("#testPushbullet-result").html(_("Please fill out the necessary fields above.")),$("#pushbullet_api").addClass("warning"))}),$("#getPushbulletDevices").on("click",()=>{e("Device list updated. Please choose a device to push to.")}),e(),$("#email_show").on("change",()=>{const t=Number.parseInt($("#email_show").val(),10);$.getJSON(scRoot+"/home/loadShowNotifyLists",e=>{0{const t=Number.parseInt($("#prowl_show").val(),10);$.getJSON(scRoot+"/home/loadShowNotifyLists",e=>{0{t()}),$("#prowl_show").on("notify",()=>{t()}),$("#email_show_save").on("click",()=>{$.post(scRoot+"/home/saveShowNotifyList",{show:$("#email_show").val(),emails:$("#email_show_list").val()},()=>{t()})}),$("#prowl_show_save").on("click",()=>{$.post(scRoot+"/home/saveShowNotifyList",{show:$("#prowl_show").val(),prowlAPIs:$("#prowl_show_list").val()},()=>{t()})}),$("#use_plex_server").on("click",function(){this.checked?$(".plexinfo").removeClass("hide"):$(".plexinfo").addClass("hide")})},postProcessing(){$("#config-components").tabs(),$("#tv_download_dir").fileBrowser({title:_("Select TV Download Directory")}),$("#unpack_dir").fileBrowser({title:_("Select Unpack Directory")});const e=function(){let o;return function(e,t){clearTimeout(o),o=setTimeout(e,t)}}();function t(){var e={};e.pattern=$("#naming_pattern").val(),e.multi=$("#naming_multi_ep :selected").val(),e.animeType=$('input[name="naming_anime"]:checked').val(),$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e.pattern},e=>{e?($("#naming_example").text(e+".ext"),$("#naming_example_div").show()):$("#naming_example_div").hide()}),$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e.pattern,multi:e.multi},e=>{e?($("#naming_example_multi").text(e+".ext"),$("#naming_example_multi_div").show()):$("#naming_example_multi_div").hide()}),$.post(scRoot+"/config/postProcessing/isNamingValid",{pattern:e.pattern,multi:e.multi},e=>{let t;"invalid"===e?(t=_("This pattern is invalid."),$("#naming_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_pattern").qtip("toggle",!0),$("#naming_pattern").css("background-color","#FFDDDD")):"seasonfolders"===e?(t=_('This pattern would be invalid without the folders, using it will force "Season Folders" on for all shows.'),$("#naming_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_pattern").qtip("toggle",!0),$("#naming_pattern").css("background-color","#FFFFDD")):(t=_("This pattern is valid."),$("#naming_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-green"}),$("#naming_pattern").qtip("toggle",!1),$("#naming_pattern").css("background-color","#FFFFFF")),$("#naming_pattern").attr("title",t)})}function o(){var e=$("#naming_abd_pattern").val();$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e,abd:"True"},e=>{e?($("#naming_abd_example").text(e+".ext"),$("#naming_abd_example_div").show()):$("#naming_abd_example_div").hide()}),$.post(scRoot+"/config/postProcessing/isNamingValid",{pattern:e,abd:"True"},e=>{let t;"invalid"===e?(t=_("This pattern is invalid."),$("#naming_abd_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_abd_pattern").qtip("toggle",!0),$("#naming_abd_pattern").css("background-color","#FFDDDD")):"seasonfolders"===e?(t=_('This pattern would be invalid without the folders, using it will force "Season Folders" on for all shows.'),$("#naming_abd_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_abd_pattern").qtip("toggle",!0),$("#naming_abd_pattern").css("background-color","#FFFFDD")):(t=_("This pattern is valid."),$("#naming_abd_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-green"}),$("#naming_abd_pattern").qtip("toggle",!1),$("#naming_abd_pattern").css("background-color","#FFFFFF")),$("#naming_abd_pattern").attr("title",t)})}function s(){var e=$("#naming_sports_pattern").val();$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e,sports:"True"},e=>{e?($("#naming_sports_example").text(e+".ext"),$("#naming_sports_example_div").show()):$("#naming_sports_example_div").hide()}),$.post(scRoot+"/config/postProcessing/isNamingValid",{pattern:e,sports:"True"},e=>{let t;"invalid"===e?(t=_("This pattern is invalid."),$("#naming_sports_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_sports_pattern").qtip("toggle",!0),$("#naming_sports_pattern").css("background-color","#FFDDDD")):"seasonfolders"===e?(t=_('This pattern would be invalid without the folders, using it will force "Season Folders" on for all shows.'),$("#naming_sports_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#naming_sports_pattern").qtip("toggle",!0),$("#naming_sports_pattern").css("background-color","#FFFFDD")):(t=_("This pattern is valid."),$("#naming_sports_pattern").qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-green"}),$("#naming_sports_pattern").qtip("toggle",!1),$("#naming_sports_pattern").css("background-color","#FFFFFF")),$("#naming_sports_pattern").attr("title",t)})}function a(){var e={};e.pattern=$("#naming_anime_pattern").val(),e.multi=$("#naming_anime_multi_ep :selected").val(),e.animeType=$('input[name="naming_anime"]:checked').val(),$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e.pattern,anime_type:e.animeType},e=>{e?($("#naming_example_anime").text(e+".ext"),$("#naming_example_anime_div").show()):$("#naming_example_anime_div").hide()}),$.post(scRoot+"/config/postProcessing/testNaming",{pattern:e.pattern,multi:e.multi,anime_type:e.animeType},e=>{e?($("#naming_example_multi_anime").text(e+".ext"),$("#naming_example_multi_anime_div").show()):$("#naming_example_multi_anime_div").hide()}),$.post(scRoot+"/config/postProcessing/isNamingValid",{pattern:e.pattern,multi:e.multi,anime_type:e.animeType},e=>{let t;var o=$("#naming_anime_pattern");"invalid"===e?(t=_("This pattern is invalid."),o.qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),o.qtip("toggle",!0),o.css("background-color","#FFDDDD")):"seasonfolders"===e?(t=_('This pattern would be invalid without the folders, using it will force "Season Folders" on for all shows.'),o.qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-red"}),o.qtip("toggle",!0),o.css("background-color","#FFFFDD")):(t=_("This pattern is valid."),o.qtip("option",{"content.text":t,"style.classes":"qtip-rounded qtip-shadow qtip-green"}),o.qtip("toggle",!1),o.css("background-color","#FFFFFF")),o.attr("title",t)})}function i(){"custom..."===$("#name_presets :selected").val().toLowerCase()?$("#naming_custom").show():($("#naming_custom").hide(),$("#naming_pattern").val($("#name_presets :selected").attr("id"))),t()}function n(){"custom..."===$("#name_abd_presets :selected").val().toLowerCase()?$("#naming_abd_custom").show():($("#naming_abd_custom").hide(),$("#naming_abd_pattern").val($("#name_abd_presets :selected").attr("id"))),o()}function r(){"custom..."===$("#name_sports_presets :selected").val().toLowerCase()?$("#naming_sports_custom").show():($("#naming_sports_custom").hide(),$("#naming_sports_pattern").val($("#name_sports_presets :selected").attr("id"))),s()}function l(){"custom..."===$("#name_anime_presets :selected").val().toLowerCase()?$("#naming_anime_custom").show():($("#naming_anime_custom").hide(),$("#naming_anime_pattern").val($("#name_anime_presets :selected").attr("id"))),a()}1!==Number.parseInt($("#unpack").val(),10)&&$("#content_unpack").hide(),$("#unpack").on("change",function(){var e=Number.parseInt(this.value,10);2!==e&&0!==e||($("#content_unpack").fadeOut("fast","linear"),$("#unpack").qtip("toggle",!1)),1===e&&($("#content_unpack").fadeIn("fast","linear"),$.post(scRoot+"/config/postProcessing/isRarSupported",e=>{"supported"!==e&&($("#unpack").qtip("option",{"content.text":"Unrar Executable not found.","style.classes":"qtip-rounded qtip-shadow qtip-red"}),$("#unpack").qtip("toggle",!0),$("#unpack").css("background-color","#FFFFDD"))}))}),$("#name_presets").on("change",i),$("#name_abd_presets").on("change",n),$("#naming_custom_abd").on("change",n),$("#name_sports_presets").on("change",r),$("#naming_custom_sports").on("change",r),$("#name_anime_presets").on("change",l),$("#naming_custom_anime").on("change",l),$('input[name="naming_anime"]').on("click",l),$("#naming_multi_ep").on("change",t),$("#naming_pattern").on("focusout",t),$("#naming_pattern").on("keyup",()=>{e(t,500)}),$("#naming_anime_multi_ep").on("change",a),$("#naming_anime_pattern").on("focusout",a),$("#naming_anime_pattern").on("keyup",()=>{e(a,500)}),$("#naming_abd_pattern").on("focusout",t),$("#naming_abd_pattern").on("keyup",()=>{e(o,500)}),$("#naming_sports_pattern").on("focusout",t),$("#naming_sports_pattern").on("keyup",()=>{e(s,500)}),$("#naming_anime_pattern").on("focusout",t),$("#naming_anime_pattern").on("keyup",()=>{e(a,500)}),$("#show_naming_key").on("click",()=>{$("#naming_key").toggle()}),$("#show_naming_abd_key").on("click",()=>{$("#naming_abd_key").toggle()}),$("#show_naming_sports_key").on("click",()=>{$("#naming_sports_key").toggle()}),$("#show_naming_anime_key").on("click",()=>{$("#naming_anime_key").toggle()}),$("#do_custom").on("click",()=>{$("#naming_pattern").val($("#name_presets :selected").attr("id")),$("#naming_custom").show(),$("#naming_pattern").focus()}),i(),n(),r(),l(),$("#metadataType").on("change keyup",function(){$(this).showHideMetadata()}),$.fn.showHideMetadata=function(){$(".metadataDiv").each(function(){var e=$(this).attr("id");$("#metadataType :selected").val()===e?$(this).show():$(this).hide()})},$(this).showHideMetadata(),$(".metadata_checkbox").on("click",function(){$(this).refreshMetadataConfig(!1)}),$.fn.refreshMetadataConfig=function(e){let m=0,_="";$(".metadataDiv").each(function(){var e=$(this).attr("id"),t=[],o=$("#"+e+"_show_metadata").is(":checked"),s=$("#"+e+"_episode_metadata").is(":checked"),a=$("#"+e+"_fanart").is(":checked"),i=$("#"+e+"_poster").is(":checked"),n=$("#"+e+"_banner").is(":checked"),r=$("#"+e+"_episode_thumbnails").is(":checked"),l=$("#"+e+"_season_posters").is(":checked"),c=$("#"+e+"_season_banners").is(":checked"),d=$("#"+e+"_season_all_poster").is(":checked"),h=$("#"+e+"_season_all_banner").is(":checked");t.push(o?"1":"0",s?"1":"0",a?"1":"0",i?"1":"0",n?"1":"0",r?"1":"0",l?"1":"0",c?"1":"0",d?"1":"0",h?"1":"0");let p=0;for(const u of t)p+=Number.parseInt(u,10);p>m&&(m=p,_=e),$("#"+e+"_eg_show_metadata").attr("class",o?"enabled":"disabled"),$("#"+e+"_eg_episode_metadata").attr("class",s?"enabled":"disabled"),$("#"+e+"_eg_fanart").attr("class",a?"enabled":"disabled"),$("#"+e+"_eg_poster").attr("class",i?"enabled":"disabled"),$("#"+e+"_eg_banner").attr("class",n?"enabled":"disabled"),$("#"+e+"_eg_episode_thumbnails").attr("class",r?"enabled":"disabled"),$("#"+e+"_eg_season_posters").attr("class",l?"enabled":"disabled"),$("#"+e+"_eg_season_banners").attr("class",c?"enabled":"disabled"),$("#"+e+"_eg_season_all_poster").attr("class",d?"enabled":"disabled"),$("#"+e+"_eg_season_all_banner").attr("class",h?"enabled":"disabled"),$("#"+e+"_data").val(t.join("|"))}),""!==_&&e&&($("#metadataType option[value="+_+"]").attr("selected","selected"),$(this).showHideMetadata())},$(this).refreshMetadataConfig(!0),$("img[title]").qtip({position:{viewport:$(window),at:"bottom center",my:"top right"},style:{tip:{corner:!0,method:"polygon"},classes:"qtip-shadow qtip-dark"}}),$("i[title]").qtip({position:{viewport:$(window),at:"top center",my:"bottom center"},style:{tip:{corner:!0,method:"polygon"},classes:"qtip-rounded qtip-shadow ui-tooltip-sb"}}),$(".custom-pattern,#unpack").qtip({content:"validating...",show:{event:!1,ready:!1},hide:!1,position:{viewport:$(window),at:"center left",my:"center right"},style:{tip:{corner:!0,method:"polygon"},classes:"qtip-rounded qtip-shadow qtip-red"}})},search(){$("#config-components").tabs(),$("#nzb_dir").fileBrowser({title:_("Select .nzb black hole/watch location")}),$("#torrent_dir").fileBrowser({title:_("Select torrent black hole/watch location")}),$("#torrent_path").fileBrowser({title:_("Select torrent download location")}),$("#torrent_path_incomplete").fileBrowser({title:_("Select torrent incomplete download location")}),$.fn.nzbMethodHandler=function(){var e=$("#nzb_method :selected").val(),t="#blackhole_settings",o="#sabnzbd_settings",s="#testSABnzbd",a="#testSABnzbd_result",i="#nzbget_settings",n="#download_station_settings",r="#testDSM",l="#testDSM_result";$("#nzb_method_icon").removeClass((e,t)=>(t.match(/(^|\s)add-client-icon-\S+/g)||[]).join(" ")),$("#nzb_method_icon").addClass("add-client-icon-"+e.replace("_","-")),$(t).hide(),$(o).hide(),$(s).hide(),$(a).hide(),$(i).hide(),$(n).hide(),$(r).hide(),$(l).hide(),("blackhole"===e.toLowerCase()?$(t):"nzbget"===e.toLowerCase()?$(i):"download_station"===e.toLowerCase()?($("#host_title").text("Synology host:port"),$("#username_title").text("Synology Username"),$("#password_title").text("Synology Password"),$(n).show(),$(r).show(),$(l)):($(o).show(),$(s).show(),$(a))).show()},$.torrentMethodHandler=()=>{$("#options_torrent_clients").hide(),$("#options_torrent_blackhole").hide();var e=$("#torrent_method :selected").val();let t="#options_torrent_blackhole",o="";$("#torrent_method_icon").removeClass((e,t)=>(t.match(/(^|\s)add-client-icon-\S+/g)||[]).join(" ")),$("#torrent_method_icon").addClass("add-client-icon-"+e.replace("_","-")),"blackhole"!==e.toLowerCase()&&($("#torrent_host_option").show(),$("#host_desc_torrent").show(),$("#torrent_rpcurl_option").hide(),$("#torrent_auth_type_option").hide(),$("#torrent_verify_cert_option").hide(),$('label[for="torrent_verify_cert"]').text(_("verify SSL certificates for HTTPS requests")),$("#username_title.component-title").text(_("Client username")),$("#torrent_username_option").show(),$("#password_title.component-title").text(_("Client password")),$("#torrent_password_option").show(),$('label[for="torrent_password"]').text(_("(blank for none)")),$("#torrent_path_option").show(),$("#torrent_path_option").find(".fileBrowser").show(),$("#torrent_path_incomplete_option").hide(),$("#path_synology").hide(),$("#torrent_seed_time_option").hide(),$("#torrent_high_bandwidth_option").hide(),$("#torrent_paused_option").show(),$("#torrent_label_option").show(),$("#label_warning_deluge").hide(),$("#label_anime_warning_deluge").hide(),$("#test_torrent_result").text(_("Click below to test")),"utorrent"===e.toLowerCase()?(o="uTorrent",$("#torrent_path_option").hide(),$("#torrent_seed_time_label").text(_("Minimum seeding time is")),$("#torrent_seed_time_option").show(),$("#host_desc_torrent").text(_("URL to your uTorrent client (e.g. http://localhost:8000)"))):"transmission"===e.toLowerCase()?(o="Transmission",$("#torrent_seed_time_label").text(_("Stop seeding when inactive for")),$("#torrent_seed_time_option").show(),$("#torrent_high_bandwidth_option").show(),$("#torrent_path_incomplete_option").show(),$("#torrent_label_option").hide(),$("#torrent_rpcurl_option").show(),$("#host_desc_torrent").text(_("URL to your Transmission client (e.g. http://localhost:9091)"))):e.toLowerCase().startsWith("deluge")?($("#torrent_verify_cert_option").show(),$("#label_warning_deluge").show(),$("#label_anime_warning_deluge").show(),$("#torrent_path_incomplete_option").show(),"deluged"===e.toLowerCase()?(o="Deluge Daemon",$("#torrent_username_option").show(),$("#host_desc_torrent").text(_("IP or Hostname of your Deluge Daemon (e.g. http://localhost:58846)"))):(o="Deluge",$("#torrent_username").prop("value",""),$("#torrent_username_option").hide(),$("#host_desc_torrent").text(_("URL to your Deluge client (e.g. http://localhost:8112)"))),$('label[for="torrent_verify_cert"]').text(_('disable if you get "Deluge: Authentication Error" in your log'))):"download_station"===e.toLowerCase()?(o="Synology DS",$("#torrent_label_option").hide(),$("#torrent_paused_option").hide(),$("#torrent_path_option").find(".fileBrowser").hide(),$("#host_desc_torrent").text(_("URL to your Synology DS client (e.g. http://localhost:5000)")),$("#path_synology").show()):"rtorrent"===e.toLowerCase()?(o="rTorrent",$("#host_desc_torrent").html(_("URL to your rTorrent client (e.g. scgi://localhost:5000 or https://localhost/rutorrent/plugins/httprpc/action.php)")),$("#torrent_verify_cert_option").show(),$("#torrent_auth_type_option").show()):"qbittorrent"===e.toLowerCase()?(o="qBittorrent",$("#torrent_path_option").show(),$("#torrent_path_option").find(".fileBrowser").show(),$("#torrent_path_incomplete_option").show(),$("#torrent_seed_time_label").text(_("Stop seeding after")),$("#torrent_seed_time_option").show(),$("#label_warning_qbittorrent").show(),$("#label_anime_warning_qbittorrent").show(),$("#torrent_verify_cert_option").show(),$("#host_desc_torrent").text(_("URL to your qBittorrent client (e.g. http://localhost:8080)"))):"mlnet"===e.toLowerCase()?(o="mlnet",$("#torrent_path_option").hide(),$("#torrent_label_option").hide(),$("#torrent_paused_option").hide(),$("#host_desc_torrent").text(_("URL to your MLDonkey (e.g. http://localhost:4080)"))):"putio"===e.toLowerCase()&&(o="putio",$("#torrent_path_option").hide(),$("#torrent_label_option").hide(),$("#torrent_paused_option").hide(),$("#torrent_host_option").hide(),$("#host_desc_torrent").text(_("URL to your putio client (e.g. http://localhost:8080)")),$('label[for="torrent_password"]').html(''+_("Create a new OAuth app for put.io")+""),$("#username_title.component-title").text(_("Put.io Parent Folder")),$("#password_title.component-title").text(_("Put.io OAuth Token"))),$("#host_title").text(o+" host:port"),$("#username_title").text(o+" Username"),$("#password_title").text(o+" Password"),$("#torrent_client").text(o),$("#rpcurl_title").text(o+" RPC URL"),t="#options_torrent_clients"),$(t).show()},$("#torrent_host").on("input",()=>{$("#torrent_method :selected").val().toLowerCase().startsWith("rtorrent")&&("scgi://"===$("#torrent_host").val().slice(0,7)?($("#torrent_username_option").hide(),$("#torrent_username").prop("value",""),$("#torrent_password_option").hide(),$("#torrent_password").prop("value",""),$("#torrent_auth_type_option").hide(),$("#torrent_auth_type option[value=none]").attr("selected","selected")):($("#torrent_username_option").show(),$("#torrent_password_option").show(),$("#torrent_auth_type_option").show()))}),$("#nzb_method").on("change",$(this).nzbMethodHandler),$(this).nzbMethodHandler(),$("#testSABnzbd").on("click",()=>{var e={};$("#testSABnzbd_result").html(loading),e.host=$("#sab_host").val(),e.username=$("#sab_username").val(),e.password=$("#sab_password").val(),e.apiKey=$("#sab_apikey").val(),$.post(scRoot+"/home/testSABnzbd",{host:e.host,username:e.username,password:e.password,apikey:e.apiKey},e=>{$("#testSABnzbd_result").html(e)})}),$("#testDSM").on("click",()=>{var e={};$("#testDSM_result").html(loading),e.host=$("#syno_dsm_host").val(),e.username=$("#syno_dsm_user").val(),e.password=$("#syno_dsm_pass").val(),$.post(scRoot+"/home/testDSM",{host:e.host,username:e.username,password:e.password},e=>{$("#testDSM_result").html(e)})}),$("#torrent_method").on("change",$.torrentMethodHandler),$.torrentMethodHandler(),$("#test_torrent").on("click",()=>{var e={};$("#test_torrent_result").html(loading),e.method=$("#torrent_method :selected").val(),e.host=$("#torrent_host").val(),e.username=$("#torrent_username").val(),e.password=$("#torrent_password").val(),$.post(scRoot+"/home/testTorrent",{torrent_method:e.method,host:e.host,username:e.username,password:e.password},e=>{$("#test_torrent_result").html(e)})}),$("#testFlareSolverr").on("click",function(){var e=$.trim($("#flaresolverr_uri").val());e?($("#flaresolverr_uri").removeClass("warning"),$(this).prop("disabled",!0),$("#testFlaresolverr-result").html(loading),$.post(scRoot+"/home/testFlareSolverr",{flaresolverr_uri:e}).done(e=>{$("#testFlaresolverr-result").html(e),$("#testFlareSolverr").prop("disabled",!1)})):($("#testFlaresolverr-result").html(_("Please fill out the necessary fields above.")),$("#flaresolverr_uri").addClass("warning"))})},subtitles(){$.fn.showHideServices=function(){$(".serviceDiv").each(function(){var e=$(this).attr("id");$("#editAService :selected").val()+"Div"===e?$(this).show():$(this).hide()})},$.fn.addService=function(e,t,o,s,a,i){null===o.match("/$")&&(o+="/"),0===$("#service_order_list > #"+e).length&&!1!==i&&(i=(i=(i=(i="")+'
",$("#service_order_list").append(i),$("#service_order_list").sortable("refresh"))},$.fn.deleteService=function(e){$("#service_order_list > #"+e).remove()},$.fn.refreshServiceList=function(){var e=$("#service_order_list").sortable("toArray");const s=[];$.each(e,(e,t)=>{var o=$("#enable_"+t).is(":checked")?"1":"0";s.push(t+":"+o)}),$("#service_order").val(s.join(" "))},$("#editAService").on("change",function(){$(this).showHideServices()}),$(".service_enabler").on("click",function(){$(this).refreshServiceList()}),$(this).showHideServices(),$("#service_order_list").sortable({placeholder:"ui-state-highlight",update(){$(this).refreshServiceList()},create(){$(this).refreshServiceList()}}),$("#service_order_list").disableSelection()},providers(){console.log("This function need to be filled with ConfigProviders.js but can't be as we've got scope issues currently.")}},home:{init(){$("#showTabs").tabs({activate(){$(".show-grid").isotope("layout")}})},index(){function o(e){let t=0,o=0,s=0,a=0;a=e<125?(s=3,4):e<175?(t=9,o=40,s=4,5):(t=11,o=50,s=6),$("#posterPopup").remove(),void 0===t?$(".show-details").hide():($(".show-details").show(),$(".show-dlstats, .show-quality").css("fontSize",t),$(".show-network-image").css("width",o)),$(".show-container").css({width:e,borderWidth:a,borderRadius:s})}$(".resetsorting").on("click",()=>{$("table").trigger("filterReset")}),$("#filterShowName").on("input",__.debounce(()=>{$(".show-grid").isotope({filter(){return $(this).find(".show-title").html().trim().toLowerCase().includes($("#filterShowName").val().toLowerCase())}})},500));let e;o(e="number"==typeof(e="undefined"!=typeof Storage?Number.parseInt(localStorage.getItem("posterSize"),10):e)&&!Number.isNaN(e)?e:188),$("#posterSizeSlider").slider({min:75,max:250,value:e,change(e,t){"undefined"!=typeof Storage&&localStorage.setItem("posterSize",t.value),o(t.value),$(".show-grid").isotope("layout")}}),$("#rootDirSelect").on("change",()=>{$("#rootDirForm").submit()}),$(".progressbar").each(function(){var e=$(this).data("progress-percentage"),t=Math.max(20,e-e%20);$(this).progressbar({value:e}),$(this).data("progress-text")&&$(this).append('
"}(s),$(".next-steps").show()}$("#searchResults").html(e),t(),$(".new-show-table").tablesorter({widgets:["stickyHeaders","zebra","saveSort"],headers:{0:{sorter:!1}}})}}))}),$("#addShowButton").on("click",()=>{if(!$('input:radio[name="whichSeries"]:checked').val())return notifyModal("You must choose a show to continue"),!1;generateBlackWhiteList(),$("#addShowForm").submit()}),$("#anime").on("click",()=>{e(),t()}),$("#skipShowButton").on("click",()=>{$("#skipShow").val("1"),$("#addShowForm").submit()}),$("#rootDirText").change(t),$("#qualityPreset").change(t),$("#searchResults").on("change",".whichSeries",t),$("#show-name").on("focus keyup",e=>{13===e.keyCode&&$("#search-button").click()}),$("#show-name").val()&&$("#search-button").click(),t(),e()},addExistingShow(){function e(){let o="";$(".dir_check").each((e,t)=>{$(t).is(":checked")&&(0 '+_("loading folders...")),$.post(scRoot+"/addShows/massAddTable/",o,e=>{$("#tableDiv").html(e),$("#addRootDirTable").tablesorter({widgets:["zebra"],headers:{0:{sorter:!1}}})})}$("#tableDiv").on("click","#checkAll",function(){const e=this.checked;$(".dirCheck").each(function(){this.checked=e})}),$("#submitShowDirs").on("click",()=>{const o=$("#addShowForm");let s=!1;if($(".dirCheck").each(function(){var e,t;!0===this.checked&&(e=$(this).attr("id"),t=$(this).closest("tr").find("select").val(),$("",{type:"hidden",name:"shows_to_add",value:t+"|"+e}).appendTo(o),s=!0)}),!1===s)return!1;$("",{type:"hidden",name:"promptForSettings",value:$("#promptForSettings").is(":checked")?"on":"off"}).appendTo(o),o.submit()});let t="";function o(){if(t===$("#rootDirText").val())return!1;t=$("#rootDirText").val(),$("#rootDirStaticList").html(""),$("#rootDirs option").each((e,t)=>{$("#rootDirStaticList").append('