fix torrent searchbox id

This commit is contained in:
xiaomlove
2022-11-05 01:39:20 +08:00
parent 7d63a0586a
commit aae99b0df1
6 changed files with 36 additions and 7 deletions

View File

@@ -301,8 +301,12 @@ class SearchRepository extends BaseRepository
$idName => $this->getTorrentId($torrent->id),
'routing' => $torrent->owner,
];
$searchBoxId = $torrent->basic_category->mode ?? 0;
if ($searchBoxId == 0) {
do_log(sprintf('[INVALID_CATEGORY], Torrent: %s', $torrent->id), 'error');
}
$data = Arr::only($torrent->toArray(), $baseFields);
$data['mode'] = $torrent->basic_category->mode;
$data['mode'] = $searchBoxId;
$body = array_merge($data, [
'_doc_type' => $docType,
'torrent_id' => $torrent->id,