added one more bt site;added the option for choosing a site to search torrents

This commit is contained in:
huangjx
2021-09-17 14:32:22 +08:00
parent 7427f395f5
commit de2afbb0ef
10 changed files with 200 additions and 47 deletions

View File

@@ -19,12 +19,15 @@ class SearchController extends Controller
$this->appName = $appName;
$this->uid = $UserId;
$this->urlGenerator = \OC::$server->getURLGenerator();
$this->search = new torrentSearch();
}
public function execute()
{
$keyword = trim($this->request->getParam('form_input_text'));
$data = torrentSearch::go($keyword);
$site = trim($this->request->getParam('select-value-search'));
$this->search->setSite($site);
$data = $this->search->go($keyword);
$resp['title'] = ['title', 'seeders', 'info', 'actions'];
$resp['row'] = $data;
return new JSONResponse($resp);