platypush/platypush/plugins/media/search/torrent.py
Fabio Manganiello 9a565061c4 Refactoring of media.search in a more scalable way. Also faster search
with workers in parallel by media type
2019-02-18 00:26:46 +01:00

15 lines
450 B
Python

from platypush.context import get_plugin
from platypush.plugins.media.search import MediaSearcher
class TorrentMediaSearcher(MediaSearcher):
def search(self, query):
self.logger.info('Searching torrents for "{}"'.format(query))
torrents = get_plugin('torrent')
if not torrents:
raise RuntimeError('Torrent plugin not available/configured')
return torrents.search(query).output
# vim:sw=4:ts=4:et: