mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
fix PTGen render when json invalid
This commit is contained in:
@@ -183,11 +183,12 @@ HTML;
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function renderDetailsPageDescription($torrentId, array $torrentPtGenArr): array
|
||||
public function renderDetailsPageDescription($torrentId, $torrentPtGenArr): array
|
||||
{
|
||||
$html = '';
|
||||
$jsonArr = [];
|
||||
$update = false;
|
||||
$torrentPtGenArr = (array)$torrentPtGenArr;
|
||||
foreach (self::$validSites as $site => $info) {
|
||||
if (empty($torrentPtGenArr[$site]['link'])) {
|
||||
continue;
|
||||
@@ -224,9 +225,10 @@ HTML;
|
||||
return ['json_arr' => $jsonArr, 'html' => $html, 'update' => $update];
|
||||
}
|
||||
|
||||
public function renderTorrentsPageAverageRating(array $ptGenData)
|
||||
public function renderTorrentsPageAverageRating($ptGenData)
|
||||
{
|
||||
$siteIdAndRating = [];
|
||||
$ptGenData = (array)$ptGenData;
|
||||
foreach (self::$validSites as $site => $info) {
|
||||
$rating = $ptGenData[$site]['data']["{$site}_rating_average"] ?? '';
|
||||
if (empty($rating)) {
|
||||
@@ -273,4 +275,4 @@ HTML;
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user