mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Adds an indexer select box in search and general search improvements
This commit is contained in:
commit
18e8b7a5aa
@ -30,6 +30,7 @@
|
|||||||
#end if
|
#end if
|
||||||
<td>
|
<td>
|
||||||
<select name="indexer">
|
<select name="indexer">
|
||||||
|
<option value="0" #if $indexer == 0 then "selected=\"selected\"" else ""#>All Indexers</option>
|
||||||
#for $curIndexer in $sickbeard.indexerApi().indexers.items():
|
#for $curIndexer in $sickbeard.indexerApi().indexers.items():
|
||||||
<option value="$curIndexer[0]" #if $curIndexer[0] == $indexer then "selected=\"selected\"" else ""#>$curIndexer[1]</option>
|
<option value="$curIndexer[0]" #if $curIndexer[0] == $indexer then "selected=\"selected\"" else ""#>$curIndexer[1]</option>
|
||||||
#end for
|
#end for
|
||||||
|
@ -37,12 +37,17 @@
|
|||||||
<input type="hidden" id="providedName" value="$provided_indexer_name" />
|
<input type="hidden" id="providedName" value="$provided_indexer_name" />
|
||||||
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
|
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
|
||||||
#else:
|
#else:
|
||||||
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
|
|
||||||
<input type="text" id="nameToSearch" value="$default_show_name" style="margin-top: 1px;" />
|
<input type="text" id="nameToSearch" value="$default_show_name" style="margin-top: 1px;" />
|
||||||
<select name="indexerLang" id="indexerLangSelect" style="height: 26px;margin-top: 1px;">
|
<select name="indexerLang" id="indexerLangSelect" style="height: 26px;margin-top: 1px;">
|
||||||
<option value="en" selected="selected">en</option>
|
<option value="en" selected="selected">en</option>
|
||||||
</select><b>*</b>
|
</select><b>*</b>
|
||||||
<input class="btn" type="button" id="searchName" value="Search" style="margin-top: -3px;" /><br /><br />
|
<select name="providedIndexer" id="providedIndexer" style="height: 26px;margin-top: 1px;">
|
||||||
|
<option value="0" #if $provided_indexer == 0 then "selected=\"selected\"" else ""#>All Indexers</option>
|
||||||
|
#for $indexer in $indexers
|
||||||
|
<option value="$indexer" #if $provided_indexer == $indexer then "selected=\"selected\"" else ""#>$indexers[$indexer]</option>
|
||||||
|
#end for
|
||||||
|
</select>
|
||||||
|
<input class="btn" type="button" id="searchName" value="Search" style="height: 26px;position:relative;top:-1px;" /><br /><br />
|
||||||
|
|
||||||
<b>*</b> This will only affect the language of the retrieved metadata file contents and episode filenames.<br />
|
<b>*</b> This will only affect the language of the retrieved metadata file contents and episode filenames.<br />
|
||||||
This <b>DOES NOT</b> allow Sick Beard to download non-english TV episodes!<br />
|
This <b>DOES NOT</b> allow Sick Beard to download non-english TV episodes!<br />
|
||||||
|
@ -29,14 +29,27 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var searchRequestXhr = null;
|
||||||
|
|
||||||
function searchIndexers() {
|
function searchIndexers() {
|
||||||
if (!$('#nameToSearch').val().length) {
|
if (!$('#nameToSearch').val().length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#searchResults').html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32.gif" height="32" width="32" /> searching...');
|
if (searchRequestXhr) searchRequestXhr.abort();
|
||||||
|
|
||||||
$.getJSON(sbRoot + '/home/addShows/searchIndexersForShowName', {'name': $('#nameToSearch').val(), 'lang': $('#indexerLangSelect').val(), 'indexer': $('#providedIndexer').val()}, function (data) {
|
var searchingFor = $('#nameToSearch').val() + ' on ' + $('#providedIndexer option:selected').text() + ' in ' + $('#indexerLangSelect').val();
|
||||||
|
$('#searchResults').empty().html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32.gif" height="32" width="32" /> searching ' + searchingFor + '...');
|
||||||
|
|
||||||
|
searchRequestXhr = $.ajax({
|
||||||
|
url: sbRoot + '/home/addShows/searchIndexersForShowName',
|
||||||
|
data: {'name': $('#nameToSearch').val(), 'lang': $('#indexerLangSelect').val(), 'indexer': $('#providedIndexer').val()},
|
||||||
|
timeout: 10000,
|
||||||
|
dataType: 'json',
|
||||||
|
error: function () {
|
||||||
|
$('#searchResults').empty().html('search timed out, try again or try another indexer');
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
var firstResult = true;
|
var firstResult = true;
|
||||||
var resultStr = '<fieldset>\n<legend>Search Results:</legend>\n';
|
var resultStr = '<fieldset>\n<legend>Search Results:</legend>\n';
|
||||||
var checked = '';
|
var checked = '';
|
||||||
@ -84,6 +97,7 @@ $(document).ready(function () {
|
|||||||
$('#searchResults').html(resultStr);
|
$('#searchResults').html(resultStr);
|
||||||
updateSampleText();
|
updateSampleText();
|
||||||
myform.loadsection(0);
|
myform.loadsection(0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2132,6 +2132,7 @@ class NewHomeAddShows:
|
|||||||
t.provided_show_dir = show_dir
|
t.provided_show_dir = show_dir
|
||||||
t.other_shows = other_shows
|
t.other_shows = other_shows
|
||||||
t.provided_indexer = int(indexer or 0)
|
t.provided_indexer = int(indexer or 0)
|
||||||
|
t.indexers = sickbeard.indexerApi().indexers
|
||||||
|
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
|
||||||
@ -2148,7 +2149,7 @@ class NewHomeAddShows:
|
|||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def addNewShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=None,
|
def addNewShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=None,
|
||||||
anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
|
anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
|
||||||
fullShowPath=None, other_shows=None, skipShow=None):
|
fullShowPath=None, other_shows=None, skipShow=None, providedIndexer=None):
|
||||||
"""
|
"""
|
||||||
Receive tvdb id, dir, and other options and create a show from them. If extra show dirs are
|
Receive tvdb id, dir, and other options and create a show from them. If extra show dirs are
|
||||||
provided then it forwards back to newShow, if not it goes to /home.
|
provided then it forwards back to newShow, if not it goes to /home.
|
||||||
|
Loading…
Reference in New Issue
Block a user