mirror of https://github.com/mashirozx/sakura.git
parent
5c58c054c5
commit
f265fe83c6
15
inc/api.php
15
inc/api.php
|
@ -453,10 +453,15 @@ function get_bgm_items($page = 1){
|
|||
}
|
||||
$lists = $bgm["list"];
|
||||
foreach ((array)$lists as $list) {
|
||||
preg_match('/第(\d+)话/m',$list['progress'], $matches_progress);
|
||||
preg_match('/第(\d+)话/m',$list["new_ep"]['index_show'], $matches_new);
|
||||
$progress = is_numeric($matches_progress[1]) ? $matches_progress[1] : 0;
|
||||
$total = is_numeric($matches_new[1]) ? $matches_new[1] : $list['total_count'];
|
||||
if(preg_match('/已看完/m',$list["new_ep"]['index_show'], $matches_finish)){
|
||||
$percent = 100;
|
||||
}else{
|
||||
preg_match('/第(\d+)话/m',$list['progress'], $matches_progress);
|
||||
preg_match('/第(\d+)话/m',$list["new_ep"]['index_show'], $matches_new);
|
||||
$progress = is_numeric($matches_progress[1]) ? $matches_progress[1] : 0;
|
||||
$total = is_numeric($matches_new[1]) ? $matches_new[1] : $list['total_count'];
|
||||
$percent = $progress / $total * 100;
|
||||
}
|
||||
$html .= '<div class="column">
|
||||
<a class="bangumi-item" href="https://bangumi.bilibili.com/anime/' . $list['season_id'] . '/" target="_blank" rel="nofollow">
|
||||
<img class="bangumi-image" src="' . str_replace('http://', 'https://', $list['cover']) . '"/>
|
||||
|
@ -464,7 +469,7 @@ function get_bgm_items($page = 1){
|
|||
<h3 class="bangumi-title" title="' . $list['title'] . '">' . $list['title'] . '</h2>
|
||||
<div class="bangumi-summary"> '. $list['evaluate'] .' </div>
|
||||
<div class="bangumi-status">
|
||||
<div class="bangumi-status-bar" style="width: '. $progress / $total * 100 .'%"></div>
|
||||
<div class="bangumi-status-bar" style="width: '. $percent .'%"></div>
|
||||
<p>' . $list['new_ep']['index_show'] . '</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue