normalize HitAndRun::getIsEnabled()

This commit is contained in:
xiaomlove
2021-06-22 14:34:45 +08:00
parent cd5f1305e9
commit 509ad392ef
2 changed files with 4 additions and 3 deletions

View File

@@ -57,7 +57,8 @@ class HitAndRun extends NexusModel
public static function getIsEnabled(): bool
{
return Setting::get('hr.mode') != self::MODE_DISABLED;
$result = Setting::get('hr.mode');
return $result && in_array($result, [self::MODE_GLOBAL, self::MODE_MANUAL]);
}
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo