diff --git a/gui/slick/interfaces/default/home_massAddTable.tmpl b/gui/slick/interfaces/default/home_massAddTable.tmpl index 6de79abf..247cf392 100644 --- a/gui/slick/interfaces/default/home_massAddTable.tmpl +++ b/gui/slick/interfaces/default/home_massAddTable.tmpl @@ -30,6 +30,7 @@ #end if #else: - * -

+ +

* This will only affect the language of the retrieved metadata file contents and episode filenames.
This DOES NOT allow Sick Beard to download non-english TV episodes!
diff --git a/gui/slick/js/newShow.js b/gui/slick/js/newShow.js index a3536c54..ef3a1d31 100644 --- a/gui/slick/js/newShow.js +++ b/gui/slick/js/newShow.js @@ -29,61 +29,75 @@ $(document).ready(function () { } } + var searchRequestXhr = null; + function searchIndexers() { if (!$('#nameToSearch').val().length) { return; } - $('#searchResults').html(' searching...'); + if (searchRequestXhr) searchRequestXhr.abort(); - $.getJSON(sbRoot + '/home/addShows/searchIndexersForShowName', {'name': $('#nameToSearch').val(), 'lang': $('#indexerLangSelect').val(), 'indexer': $('#providedIndexer').val()}, function (data) { - var firstResult = true; - var resultStr = '
\nSearch Results:\n'; - var checked = ''; + var searchingFor = $('#nameToSearch').val() + ' on ' + $('#providedIndexer option:selected').text() + ' in ' + $('#indexerLangSelect').val(); + $('#searchResults').empty().html(' searching ' + searchingFor + '...'); - if (data.results.length === 0) { - resultStr += 'No results found, try a different search.'; - } else { - $.each(data.results, function (index, obj) { - if (firstResult) { - checked = ' checked'; - firstResult = false; - } else { - checked = ''; - } + 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 resultStr = '
\nSearch Results:\n'; + var checked = ''; - var whichSeries = obj.join('|'); - - - resultStr += ' '; - if (data.langid && data.langid != "") { - resultStr += '' + obj[4] + ''; - } else { - resultStr += '' + obj[4] + ''; - } - - if (obj[5] !== null) { - var startDate = new Date(obj[5]); - var today = new Date(); - if (startDate > today) { - resultStr += ' (will debut on ' + obj[5] + ')'; + if (data.results.length === 0) { + resultStr += 'No results found, try a different search.'; + } else { + $.each(data.results, function (index, obj) { + if (firstResult) { + checked = ' checked'; + firstResult = false; } else { - resultStr += ' (started on ' + obj[5] + ')'; + checked = ''; } - } - if (obj[0] !== null) { - resultStr += ' [' + obj[0] + ']'; - } + var whichSeries = obj.join('|'); - resultStr += '
'; - }); - resultStr += ''; + + resultStr += ' '; + if (data.langid && data.langid != "") { + resultStr += '' + obj[4] + ''; + } else { + resultStr += '' + obj[4] + ''; + } + + if (obj[5] !== null) { + var startDate = new Date(obj[5]); + var today = new Date(); + if (startDate > today) { + resultStr += ' (will debut on ' + obj[5] + ')'; + } else { + resultStr += ' (started on ' + obj[5] + ')'; + } + } + + if (obj[0] !== null) { + resultStr += ' [' + obj[0] + ']'; + } + + resultStr += '
'; + }); + resultStr += ''; + } + resultStr += '
'; + $('#searchResults').html(resultStr); + updateSampleText(); + myform.loadsection(0); } - resultStr += '
'; - $('#searchResults').html(resultStr); - updateSampleText(); - myform.loadsection(0); }); } diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 570571d4..b9778c24 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1976,6 +1976,8 @@ class NewHomeAddShows: # check for indexer preset indexers = sickbeard.indexerApi().indexers if not int(indexer) else [int(indexer or 0)] + print repr(indexers) + # Query Indexers for each search term and build the list of results for indexer in indexers: results = [] @@ -2132,6 +2134,7 @@ class NewHomeAddShows: t.provided_show_dir = show_dir t.other_shows = other_shows t.provided_indexer = int(indexer or 0) + t.indexers = sickbeard.indexerApi().indexers return _munge(t) @@ -2148,7 +2151,7 @@ class NewHomeAddShows: @cherrypy.expose def addNewShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=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 provided then it forwards back to newShow, if not it goes to /home.