promotion info do not inject to torrent object

This commit is contained in:
xiaomlove
2022-06-10 03:45:59 +08:00
parent 35f78b4b77
commit 86bc6ae900
2 changed files with 8 additions and 11 deletions

View File

@@ -158,16 +158,7 @@ class Torrent extends NexusModel
}
$spState = $this->sp_state;
$global = self::getGlobalPromotionState();
$log = sprintf('torrent: %s original sp_state: %s, original global_sp_state: %s', $this->id, $spState, $global);
if ($this->__sticky_promotion) {
//Cover original sp_state
$spState = $this->__sticky_promotion['promotion_type'];
$log .= "[SP_STATE_CHANGE] to __sticky_promotion: $spState]";
}
if ($this->__ignore_global_sp_state) {
$global = self::PROMOTION_NORMAL;
$log .= "[IGNORE_GLOBAL_SP_STATE], reset to: $global";
}
$log = sprintf('torrent: %s sp_state: %s, global sp state: %s', $this->id, $spState, $global);
if ($global != self::PROMOTION_NORMAL) {
$spState = $global;
$log .= sprintf(", global != %s, set sp_state to global: %s", self::PROMOTION_NORMAL, $global);