Commit c5327f57 authored by echel0n's avatar echel0n
Browse files

Added ability to add new shows using quicksearch.

Bugfixed Torrent9 provider.
parent adcf7e11
This diff is collapsed.
......@@ -371,6 +371,7 @@ def findCertainShow(indexerid, return_show_object=True):
"""
Find a show by indexer ID in the show list
:param return_show_object: returns a show object if True
:param showList: List of shows to search in (needle)
:param indexerid: Show to look for
:return: result list
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -564,8 +564,19 @@ class WebRoot(WebHandler):
return self.redirect('/logout/')
def quicksearch_json(self, term):
return json_encode(
sickrage.app.quicksearch_cache.get_shows(term) + sickrage.app.quicksearch_cache.get_episodes(term))
shows = sickrage.app.quicksearch_cache.get_shows(term)
episodes = sickrage.app.quicksearch_cache.get_episodes(term)
if not len(shows):
shows = [{
'category': 'shows',
'showid': '',
'name': term,
'img': '/images/poster-thumb.png',
'seasons': 0,
}]
return json_encode(shows + episodes)
@Route('/browser(/?.*)')
......
......@@ -31,12 +31,12 @@ from sickrage.providers import TorrentProvider
class Torrent9Provider(TorrentProvider):
def __init__(self):
super(Torrent9Provider, self).__init__('Torrent9', 'ww1.torrent9.ph', False)
super(Torrent9Provider, self).__init__('Torrent9', 'https://www.torrent9.ph', False)
self.urls.update({
'search': '{base_url}/search_torrent/'.format(**self.urls),
'rss': '{base_url}/torrents_series.html,trie-date-d'.format(**self.urls),
'download': '{base_url}get_torrent/%s.torrent'.format(**self.urls)
'download': '{base_url}/get_torrent/%s.torrent'.format(**self.urls)
})
self.minseed = None
......
......@@ -175,15 +175,28 @@ $(document).ready(function ($) {
});
if (item.category === 'shows') {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/displayShow?show=${item.showid}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
if (item.showid) {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/displayShow?show=${item.showid}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
} else {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/addShows/newShow?search_string=${item.name}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
}
$li.append($a);
$li.find('a').append($('<div class="row"><div class="col-2"><div id="show-img"></div></div><div class="col-10"><div class="row"><strong id="show-name" class="text-white text-truncate"></strong></div><div class="row"><strong id="show-seasons" class="text-secondary"></strong></div></div></div>'));
$li.find('#show-img').append($img);
$li.find('#show-name').append(item.name);
if (item.showid) {
$li.find('#show-name').append(item.name);
} else {
$li.find('#show-name').append('Add new show: ' + item.name);
}
$li.find('#show-seasons').append(item.seasons + ' seasons');
} else {
$a.attr({
......
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