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

@@ -303,7 +303,12 @@ class Torrent extends NexusModel
public function getHrAttribute(): string
{
// $hrMode = Setting::get('hr.mode');
$hrMode = HitAndRun::getConfig('mode', $this->basic_category->mode);
$searchBoxId = $this->basic_category->mode ?? 0;
if ($searchBoxId == 0) {
do_log(sprintf('[INVALID_CATEGORY], Torrent: %s, category: %s invalid', $this->id, $this->category), 'error');
return self::HR_NO;
}
$hrMode = HitAndRun::getConfig('mode', $searchBoxId);
if ($hrMode == HitAndRun::MODE_GLOBAL) {
return self::HR_YES;
}