Cleanup searcher PR
This commit is contained in:
1 parent
f2b483b16e
commit
47de84259d
4 files changed
+10
-21
No files matched your search
@@ -1,7 +1,7 @@
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import simplifyString, toUnicode
|
||||
from couchpotato.core.helpers.variable import md5, getTitle, splitString
|
||||
from couchpotato.core.helpers.encoding import simplifyString
|
||||
from couchpotato.core.helpers.variable import splitString
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.media._base.searcher.base import SearcherBase
|
||||
import datetime
|
||||
@@ -47,11 +47,8 @@ class Searcher(SearcherBase):
|
||||
def search(self, protocols, media, quality):
|
||||
results = []
|
||||
|
||||
# TODO could this be handled better? (removing the need for 'searcher.get_media_searcher_id')
|
||||
searcher_id = fireEvent('searcher.get_media_searcher_id', media['type'], single = True)
|
||||
|
||||
for search_protocol in protocols:
|
||||
protocol_results = fireEvent('provider.search.%s.%s' % (search_protocol, searcher_id), media, quality, merge = True)
|
||||
protocol_results = fireEvent('provider.search.%s.%s' % (search_protocol, media['type']), media, quality, merge = True)
|
||||
if protocol_results:
|
||||
results += protocol_results
|
||||
|
||||
|
||||
Reference in new issue
Block a user