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(