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