[TV] Added "full_search" placeholder methods to avoid errors on startup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from couchpotato import fireEvent, get_db, Env
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent
|
||||
from couchpotato.core.event import addEvent, fireEventAsync
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.media._base.searcher.base import SearcherBase
|
||||
from couchpotato.core.media._base.searcher.main import SearchSetupError
|
||||
@@ -19,11 +19,26 @@ class EpisodeSearcher(SearcherBase, ShowTypeBase):
|
||||
def __init__(self):
|
||||
super(EpisodeSearcher, self).__init__()
|
||||
|
||||
addEvent('%s.searcher.all' % self.getType(), self.searchAll)
|
||||
addEvent('%s.searcher.single' % self.getType(), self.single)
|
||||
addEvent('searcher.correct_release', self.correctRelease)
|
||||
|
||||
addApiView('%s.searcher.full_search' % self.getType(), self.searchAllView, docs = {
|
||||
'desc': 'Starts a full search for all wanted shows',
|
||||
})
|
||||
|
||||
addApiView('%s.searcher.single' % self.getType(), self.singleView)
|
||||
|
||||
def searchAllView(self, **kwargs):
|
||||
fireEventAsync('%s.searcher.all' % self.getType(), manual = True)
|
||||
|
||||
return {
|
||||
'success': not self.in_progress
|
||||
}
|
||||
|
||||
def searchAll(self, manual = False):
|
||||
pass
|
||||
|
||||
def singleView(self, media_id, **kwargs):
|
||||
db = get_db()
|
||||
media = db.get('id', media_id)
|
||||
|
||||
18
couchpotato/core/media/show/searcher/season.py
Normal file → Executable file
18
couchpotato/core/media/show/searcher/season.py
Normal file → Executable file
@@ -1,4 +1,5 @@
|
||||
from couchpotato.core.event import addEvent
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent, fireEventAsync
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.media._base.searcher.base import SearcherBase
|
||||
from couchpotato.core.media.show import ShowTypeBase
|
||||
@@ -16,8 +17,23 @@ class SeasonSearcher(SearcherBase, ShowTypeBase):
|
||||
def __init__(self):
|
||||
super(SeasonSearcher, self).__init__()
|
||||
|
||||
addEvent('%s.searcher.all' % self.getType(), self.searchAll)
|
||||
addEvent('%s.searcher.single' % self.getType(), self.single)
|
||||
|
||||
addApiView('%s.searcher.full_search' % self.getType(), self.searchAllView, docs = {
|
||||
'desc': 'Starts a full search for all wanted seasons',
|
||||
})
|
||||
|
||||
def searchAllView(self, **kwargs):
|
||||
fireEventAsync('%s.searcher.all' % self.getType(), manual = True)
|
||||
|
||||
return {
|
||||
'success': not self.in_progress
|
||||
}
|
||||
|
||||
def searchAll(self, manual = False):
|
||||
pass
|
||||
|
||||
def single(self, media, show, profile):
|
||||
|
||||
# Check if any episode is already snatched
|
||||
|
||||
19
couchpotato/core/media/show/searcher/show.py
Normal file → Executable file
19
couchpotato/core/media/show/searcher/show.py
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
from couchpotato import get_db
|
||||
from couchpotato.core.event import fireEvent, addEvent
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import fireEvent, addEvent, fireEventAsync
|
||||
from couchpotato.core.helpers.variable import getTitle
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.media._base.searcher.base import SearcherBase
|
||||
@@ -19,10 +20,24 @@ class ShowSearcher(SearcherBase, ShowTypeBase):
|
||||
def __init__(self):
|
||||
super(ShowSearcher, self).__init__()
|
||||
|
||||
addEvent('%s.searcher.all' % self.getType(), self.searchAll)
|
||||
addEvent('%s.searcher.single' % self.getType(), self.single)
|
||||
|
||||
addEvent('searcher.get_search_title', self.getSearchTitle)
|
||||
|
||||
addApiView('%s.searcher.full_search' % self.getType(), self.searchAllView, docs = {
|
||||
'desc': 'Starts a full search for all wanted episodes',
|
||||
})
|
||||
|
||||
def searchAllView(self, **kwargs):
|
||||
fireEventAsync('%s.searcher.all' % self.getType(), manual = True)
|
||||
|
||||
return {
|
||||
'success': not self.in_progress
|
||||
}
|
||||
|
||||
def searchAll(self, manual = False):
|
||||
pass
|
||||
|
||||
def single(self, media, search_protocols = None, manual = False):
|
||||
# Find out search type
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user