mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
peer location relative to privacy
This commit is contained in:
@@ -179,7 +179,7 @@ class Torrent extends NexusModel
|
||||
throw new \RuntimeException('no select sp_state field');
|
||||
}
|
||||
$spState = $this->sp_state;
|
||||
$global = self::getGlobalPromotionState();
|
||||
$global = get_global_sp_state();
|
||||
$log = sprintf('torrent: %s sp_state: %s, global sp state: %s', $this->id, $spState, $global);
|
||||
if ($global != self::PROMOTION_NORMAL) {
|
||||
$spState = $global;
|
||||
@@ -214,18 +214,6 @@ class Torrent extends NexusModel
|
||||
);
|
||||
}
|
||||
|
||||
public static function getGlobalPromotionState()
|
||||
{
|
||||
if (is_null(self::$globalPromotionState)) {
|
||||
$result = TorrentState::query()->first(['global_sp_state']);
|
||||
if (!$result) {
|
||||
do_log("global sp state no value", 'error');
|
||||
}
|
||||
self::$globalPromotionState = $result->global_sp_state ?? false;
|
||||
}
|
||||
return self::$globalPromotionState;
|
||||
}
|
||||
|
||||
public static function getFieldsForList($appendTableName = false): array|bool
|
||||
{
|
||||
$fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr, approval_status';
|
||||
|
||||
Reference in New Issue
Block a user