Commit 085b442c authored by echel0n's avatar echel0n
Browse files

Shows returned from search filtered if show in library

parent c0274a90
# Changelog
- * a3cfd56 - 2018-08-26: Release v9.3.60
- * 7ca3b86 - 2018-08-26: Shows returned from search filtered if show in library
- * ebd6252 - 2018-08-26: Release v9.3.60
- * a92e6b5 - 2018-08-26: Fixed issue with TheTVDB cache storing dict keys as strings instead of integer
- * 1b42b83 - 2018-08-26: Pre-Release v9.3.60.dev1
- * 55e4104 - 2018-08-26: Fixed issue where click event for adding root folders was being fired more then twice.
......
......@@ -374,7 +374,7 @@ def remove_file_failed(failed_file):
pass
def findCertainShow(indexerid):
def findCertainShow(indexerid, return_show_object=True):
"""
Find a show by indexer ID in the show list
......@@ -393,7 +393,10 @@ def findCertainShow(indexerid):
return None
if len(results) == 1:
return results[0]
if return_show_object:
return results[0]
else:
return True
raise MultipleShowObjectsException()
......
......@@ -296,6 +296,7 @@ class LogoutHandler(BaseHandler):
self.clear_all_cookies()
return self.redirect('/login/')
class CalendarHandler(BaseHandler):
def prepare(self, *args, **kwargs):
if sickrage.app.config.calendar_unprotected:
......@@ -2267,9 +2268,9 @@ class HomeAddShows(Home):
continue
for i, shows in results.items():
final_results.extend(
[[IndexerApi(i).name, i, IndexerApi(i).config["show_url"],
int(show['id']), show['seriesname'], show['firstaired']] for show in shows])
final_results.extend([[IndexerApi(i).name, i, IndexerApi(i).config["show_url"],
int(show['id']), show['seriesname'], show['firstaired'],
('', 'disabled')[bool(findCertainShow(show['id'], False))]] for show in shows])
lang_id = IndexerApi().indexer().languages[lang] or 7
return json_encode({'results': final_results, 'langid': lang_id})
......
......@@ -2699,7 +2699,7 @@ $(document).ready(function ($) {
var whichSeries = obj.join('|');
resultStr += '<input type="radio" class="pull-left" id="whichSeries" name="whichSeries" value="' + whichSeries.replace(/"/g, "") + '"' + checked + ' /> ';
resultStr += '<input type="radio" class="pull-left" id="whichSeries" name="whichSeries" value="' + whichSeries.replace(/"/g, "") + '"' + checked + ' ' + obj[6] + ' /> ';
resultStr += '<a href="' + SICKRAGE.anonURL + obj[2] + obj[3] + '&lid=' + data.langid + '" onclick="window.open(this.href, \'_blank\'); return false;" ><b>' + obj[4] + '</b></a>';
if (obj[5] !== null) {
......@@ -2716,6 +2716,10 @@ $(document).ready(function ($) {
resultStr += ' [' + obj[0] + ']';
}
if (obj[6] == 'disabled') {
resultStr += '<div class="d-inline text-danger font-weight-bold">' + gt(' already exists in show library') + '</div>';
}
resultStr += '<br/>';
});
resultStr += '</ul>';
......
Supports Markdown
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