Commit a4e25d1c authored by echel0n's avatar echel0n

Refactored jQuery search client code, resolves issues with form validation.

parent 798def65
......@@ -80,7 +80,7 @@ class BacklogSearcher(object):
if not show_id and self.forced:
sickrage.app.log.info("Running limited backlog on missed episodes " + str(sickrage.app.config.backlog_days) + " day(s) old")
from_date = datetime.date.today() - datetime.timedelta(days=sickrage.app.config.backlog_days)
else:
elif len(show_list):
sickrage.app.log.info('Running full backlog search on missed episodes for selected shows')
# go through non air-by-date shows and see if they need any episodes
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -816,7 +816,7 @@
</div>
<div id="options_torrent_clients">
<div class="form-row form-group">
<div class="form-row form-group" id="torrent_host_option">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title" id="host_title">${_('Torrent host:port')}</label>
</div>
......@@ -827,13 +827,11 @@
</div>
<input name="torrent_host" id="torrent_host"
value="${sickrage.app.config.torrent_host}"
placeholder="${_('ex. http://localhost:8000/')}"
title="URL to your torrent client"
class="form-control"
autocapitalize="off"
type="url"
pattern="https?://.+:[0-9]+/?"
required>
pattern="https?://.+:[0-9]+/?">
<div class="invalid-tooltip">
Please fill in a valid URL.
</div>
......
......@@ -3264,15 +3264,14 @@ $(document).ready(function ($) {
optionPanel = '#options_torrent_blackhole',
rpcurl = ' RPC URL';
$('#torrent_method_icon').removeClass(function (index, css) {
return (css.match(/(^|\s)add-client-icon-\S+/g) || []).join(' ');
});
$('#torrent_method_icon').addClass('add-client-icon-' + selectedProvider.replace('_', '-'));
// $('#torrent_method_icon').removeClass(function (index, css) {
// return (css.match(/(^|\s)add-client-icon-\S+/g) || []).join(' ');
// });
// $('#torrent_method_icon').addClass('add-client-icon-' + selectedProvider.replace('_', '-'));
if (selectedProvider.toLowerCase() !== 'blackhole') {
$('#label_warning_deluge').hide();
$('#label_anime_warning_deluge').hide();
$('#host_desc_torrent').show();
$('#torrent_verify_cert_option').hide();
$('#torrent_verify_deluge').hide();
$('#torrent_verify_rtorrent').hide();
......@@ -3292,7 +3291,8 @@ $(document).ready(function ($) {
$('#torrent_path_option').hide();
$('#torrent_seed_time_label').text(gt('Minimum seeding time is'));
$('#torrent_seed_time_option').show();
$('#host_desc_torrent').text(gt('URL to your uTorrent client (e.g. http://localhost:8000)'));
$('#torrent_host').attr('placeholder', gt('URL to your uTorrent client (e.g. http://localhost:8000)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'transmission') {
client = 'Transmission';
$('#torrent_seed_time_label').text(gt('Stop seeding when inactive for'));
......@@ -3301,7 +3301,8 @@ $(document).ready(function ($) {
$('#torrent_label_option').hide();
$('#torrent_label_anime_option').hide();
$('#torrent_rpcurl_option').show();
$('#host_desc_torrent').text(gt('URL to your Transmission client (e.g. http://localhost:9091)'));
$('#torrent_host').attr('placeholder', gt('URL to your Transmission client (e.g. http://localhost:9091)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'deluge') {
client = 'Deluge';
$('#torrent_verify_cert_option').show();
......@@ -3311,7 +3312,8 @@ $(document).ready(function ($) {
$('#label_anime_warning_deluge').show();
$('#torrent_username_option').hide();
$('#torrent_username').prop('value', '');
$('#host_desc_torrent').text(gt('URL to your Deluge client (e.g. http://localhost:8112)'));
$('#torrent_host').attr('placeholder', gt('URL to your Deluge client (e.g. http://localhost:8112)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'deluged') {
client = 'Deluge';
$('#torrent_verify_cert_option').hide();
......@@ -3320,29 +3322,33 @@ $(document).ready(function ($) {
$('#label_warning_deluge').show();
$('#label_anime_warning_deluge').show();
$('#torrent_username_option').show();
$('#host_desc_torrent').text(gt('IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)'));
$('#torrent_host').attr('placeholder', gt('IP or Hostname of your Deluge Daemon (e.g. scgi://localhost:58846)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'download_station') {
client = 'Synology DS';
$('#torrent_label_option').hide();
$('#torrent_label_anime_option').hide();
$('#torrent_paused_option').hide();
$('#torrent_path_option').find('.fileBrowser').hide();
$('#host_desc_torrent').text(gt('URL to your Synology DS client (e.g. http://localhost:5000)'));
$('#torrent_host').attr('placeholder', gt('URL to your Synology DS client (e.g. http://localhost:5000)'));
$('#torrent_host').prop('required',true);
$('#path_synology').show();
} else if (selectedProvider.toLowerCase() === 'rtorrent') {
client = 'rTorrent';
$('#torrent_paused_option').hide();
$('#host_desc_torrent').html(gt('URL to your rTorrent client (e.g. scgi://localhost:5000') + '<br>' + gt(' or https://localhost/rutorrent/plugins/httprpc/action.php)'));
$('#torrent_host').attr('placeholder', gt('URL to your rTorrent client (e.g. scgi://localhost:5000') + '<br>' + gt(' or https://localhost/rutorrent/plugins/httprpc/action.php)'));
$('#torrent_verify_cert_option').show();
$('#torrent_verify_deluge').hide();
$('#torrent_verify_rtorrent').show();
$('#torrent_auth_type_option').show();
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'qbittorrent') {
client = 'qbittorrent';
$('#torrent_path_option').hide();
$('#label_warning_qbittorrent').show();
$('#label_anime_warning_qbittorrent').show();
$('#host_desc_torrent').text(gt('URL to your qbittorrent client (e.g. http://localhost:8080)'));
$('#torrent_host').attr('placeholder', gt('URL to your qbittorrent client (e.g. http://localhost:8080)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'mlnet') {
client = 'mlnet';
$('#torrent_path_option').hide();
......@@ -3352,7 +3358,8 @@ $(document).ready(function ($) {
$('#torrent_verify_rtorrent').hide();
$('#torrent_label_anime_option').hide();
$('#torrent_paused_option').hide();
$('#host_desc_torrent').text(gt('URL to your MLDonkey (e.g. http://localhost:4080)'));
$('#torrent_host').attr('placeholder', gt('URL to your MLDonkey (e.g. http://localhost:4080)'));
$('#torrent_host').prop('required',true);
} else if (selectedProvider.toLowerCase() === 'putio') {
client = 'putio';
$('#torrent_path_option').hide();
......@@ -3363,15 +3370,21 @@ $(document).ready(function ($) {
$('#torrent_label_anime_option').hide();
$('#torrent_paused_option').hide();
$('#torrent_host_option').hide();
$('#host_desc_torrent').text(gt('URL to your putio client (e.g. http://localhost:8080)'));
$('#torrent_host').attr('placeholder', gt('URL to your putio client (e.g. http://localhost:8080)'));
$('#torrent_host').prop('required',true);
}
$('#host_title').text(client + host);
$('#username_title').text(client + username);
$('#password_title').text(client + password);
$('#torrent_client').text(client);
$('#rpcurl_title').text(client + rpcurl);
optionPanel = '#options_torrent_clients';
} else {
$('#torrent_host').prop('required',false);
}
$(optionPanel).show();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment