diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 3cfc2eba..73999038 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -77,9 +77,9 @@ class Test extends Command */ public function handle() { - $torrent = Torrent::query()->first(); - $torrent->name = Carbon::now()->toDateTimeString(); - $torrent->update(['seeders' => 100]); + $torrent = \App\Models\Torrent::query()->find(3); + $promotionInfo = apply_filter('torrent_promotion', $torrent->toArray()); + dd($promotionInfo); } diff --git a/app/Repositories/TrackerRepository.php b/app/Repositories/TrackerRepository.php index 488356e3..d1b23826 100644 --- a/app/Repositories/TrackerRepository.php +++ b/app/Repositories/TrackerRepository.php @@ -679,9 +679,10 @@ class TrackerRepository extends BaseRepository $spStateReal = $torrent->spStateReal; $log .= "[SP_STATE_REAL]: $spStateReal"; $promotionInfo = apply_filter('torrent_promotion', $torrent->toArray()); - if ($promotionInfo) { + do_log("promotionInfo from filter torrent_promotion by torrent: " . $torrent->toArray() . ", get : " . json_encode($promotionInfo)); + if ($promotionInfo['sp_state'] != $spStateReal) { $spStateReal = $promotionInfo['sp_state']; - $log .= "[CHANGE_SP_STATE_BY_FILTER_TORRENT_PROMOTION]: $spStateReal"; + $log .= "[CHANGE_SP_STATE_REAL_BY_FILTER_TORRENT_PROMOTION]: $spStateReal"; } $uploaderRatio = Setting::get('torrent.uploaderdouble'); $log .= ", spStateReal: $spStateReal, uploaderRatio: $uploaderRatio";