mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix parse_imdb_id()
This commit is contained in:
+4
-3
@@ -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(
|
||||
|
||||
@@ -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>',
|
||||
),
|
||||
);
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user