fix listRatings() if no PT-Gen data error

This commit is contained in:
xiaomlove
2022-04-14 14:05:51 +08:00
parent c88ebcdfa9
commit 7bbb794859
+1 -1
View File
@@ -76,7 +76,7 @@ class Torrent
}
$ptGenInfo = json_decode($torrentInfo['pt_gen'], true);
$log = "torrent: " . $torrentInfo['id'];
$siteIdAndRating = $ptGen->listRatings($ptGenInfo, $torrentInfo['url']);
$siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']);
$log .= "siteIdAndRating: " . json_encode($siteIdAndRating);
do_log($log);
return $ptGen->buildRatingSpan($siteIdAndRating);