From 87f6f0477a77a2abdce278d4dff64ed56532b383 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 8 Jun 2022 18:37:27 +0800 Subject: [PATCH] fix torrent list ptgen array render --- nexus/Torrent/Torrent.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nexus/Torrent/Torrent.php b/nexus/Torrent/Torrent.php index 4cac48d4..c2427110 100644 --- a/nexus/Torrent/Torrent.php +++ b/nexus/Torrent/Torrent.php @@ -74,7 +74,11 @@ class Torrent if (is_null($ptGen)) { $ptGen = new PTGen(); } - $ptGenInfo = json_decode($torrentInfo['pt_gen'], true); + $ptGenInfo = $torrentInfo['pt_gen']; + if (!is_array($torrentInfo['pt_gen'])) { + $ptGenInfo = json_decode($ptGenInfo, true); + } + $log = "torrent: " . $torrentInfo['id']; $siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']); $log .= "siteIdAndRating: " . json_encode($siteIdAndRating);