fix torrent list ptgen array render

This commit is contained in:
xiaomlove
2022-06-08 18:37:27 +08:00
parent fa66aa5887
commit 87f6f0477a

View File

@@ -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);