mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
add PT-Gen api point setting
This commit is contained in:
@@ -253,4 +253,22 @@ class Imdb
|
||||
return $autodata;
|
||||
|
||||
}
|
||||
|
||||
public function renderTorrentsPageAverageRating(int $imdbId)
|
||||
{
|
||||
$imdbId = parse_imdb_id($imdbId);
|
||||
if ($this->getCacheStatus($imdbId) != 1) {
|
||||
return '';
|
||||
}
|
||||
$movie = $this->getMovie($imdbId);
|
||||
$site = 'imdb';
|
||||
$rating = $movie->rating();
|
||||
$result = '<td class="embedded" style="text-align: right; width: 40px;padding-right: 5px"><div style="display: flex;flex-direction: column">';
|
||||
$result .= sprintf(
|
||||
'<div style="display: flex;align-content: center;justify-content: space-between;padding: 2px 0"><img src="%s" alt="%s" title="%s" style="max-width: 16px;max-height: 16px"/><span>%s</span></div>',
|
||||
'pic/imdb2.png', $site, $site, $rating
|
||||
);
|
||||
$result .= '</div></td>';
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,19 @@ class PTGen
|
||||
self::SITE_BANGUMI => [
|
||||
'url_pattern' => '/(?:https?:\/\/)?(?:bgm\.tv|bangumi\.tv|chii\.in)\/subject\/(\d+)\/?/',
|
||||
'home_page' => 'https://bangumi.tv/',
|
||||
'rating_average_img' => 'pic/douban2.png',
|
||||
'rating_average_img' => 'pic/bangumi.jpg',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setApiPoint('https://ptgen.rhilip.info');
|
||||
$setting = get_setting('main');
|
||||
if (empty($setting['pt_gen_api_point'])) {
|
||||
do_log("empty PT-Gen api point", 'warning');
|
||||
} else {
|
||||
$this->setApiPoint($setting['pt_gen_api_point']);
|
||||
}
|
||||
}
|
||||
|
||||
public function getApiPoint(): string
|
||||
|
||||
Reference in New Issue
Block a user