add torrent pos_state_until

This commit is contained in:
xiaomlove
2022-09-17 18:55:26 +08:00
parent fedc67ad5e
commit 1a0ad86b32
10 changed files with 160 additions and 4 deletions

View File

@@ -256,6 +256,21 @@ class Torrent extends NexusModel
return $result;
}
public static function listPickInfo($onlyKeyValue = false, $valueField = 'text'): array
{
$result = self::$pickTypes;
$keyValue = [];
foreach ($result as $status => &$info) {
$text = nexus_trans('torrent.pick_info.' . $status);
$info['text'] = $text;
$keyValue[$status] = $info[$valueField];
}
if ($onlyKeyValue) {
return $keyValue;
}
return $result;
}
public function getHrAttribute(): string
{
$hrMode = Setting::get('hr.mode');