fix parse_imdb_id()

This commit is contained in:
xiaomlove
2021-03-17 18:46:40 +08:00
parent 96a8089092
commit f341901def
6 changed files with 95 additions and 22 deletions
+4 -3
View File
@@ -257,13 +257,14 @@ class Imdb
public function renderTorrentsPageAverageRating($imdbId)
{
$imdbId = parse_imdb_id($imdbId);
$defaultRating = $rating = 'N/A';
if ($imdbId && $this->getCacheStatus($imdbId) == 1) {
$movie = $this->getMovie($imdbId);
$rating = $movie->rating();
} else {
$rating = 'N/A';
}
if (!is_numeric($rating)) {
$rating = $defaultRating;
}
$site = 'imdb';
$result = '<td class="embedded" style="text-align: right; width: 40px;padding: 4px"><div style="display: flex;flex-direction: column">';
$result .= sprintf(
+2 -2
View File
@@ -353,8 +353,8 @@
'code' =>
array (
'mainversion' => 'NexusPHP',
'subversion' => 'v1.6.0-beta3',
'releasedate' => '2021-02-23',
'subversion' => 'v1.6.0-beta4',
'releasedate' => '2021-03-17',
'website' => '<a href="https://nexusphp.org" target="_blank">https://nexusphp.org</a>',
),
);
+2 -3
View File
@@ -52,16 +52,15 @@ class Torrent
public function renderProgressBar($activeStatus, $progress)
{
$color = '#aaa';
$title = $activeStatus;
if ($activeStatus == 'seeding') {
$color = 'green';
} elseif ($activeStatus == 'leeching') {
$color = 'red';
$color = 'blue';
}
$progress = ($progress * 100) . '%';
$result = sprintf(
'<div style="padding: 1px;margin-top: 2px;border: 1px solid #838383" title="%s"><div style="width: %s;background-color: %s;height: 2px"></div></div>',
$title . " $progress", $progress, $color
$activeStatus . " $progress", $progress, $color
);
return $result;
}