Exemple #1
0
 def _forceBookSearch(self, **kwargs):
     if 'type' in kwargs:
         library = kwargs['type']
     else:
         library = None
     if lazylibrarian.USE_NZB() or lazylibrarian.USE_TOR() or lazylibrarian.USE_RSS() or lazylibrarian.USE_DIRECT():
         if 'wait' in kwargs:
             search_book(library=library)
         else:
             threading.Thread(target=search_book, name='API-SEARCHBOOK', args=[None, library]).start()
     else:
         self.data = "No search methods set, check config"
Exemple #2
0
    def _searchBook(self, **kwargs):
        if 'id' not in kwargs:
            self.data = 'Missing parameter: id'
            return

        books = [{"bookid": kwargs['id']}]
        if 'type' in kwargs:
            library = kwargs['type']
        else:
            library = None

        if lazylibrarian.USE_NZB() or lazylibrarian.USE_TOR() or lazylibrarian.USE_RSS() or lazylibrarian.USE_DIRECT():
            if 'wait' in kwargs:
                search_book(books=books, library=library)
            else:
                threading.Thread(target=search_book, name='API-SEARCHBOOK', args=[books, library]).start()
        else:
            self.data = "No search methods set, check config"