diff --git a/inc/api.php b/inc/api.php index 498d742..3ec4b8c 100644 --- a/inc/api.php +++ b/inc/api.php @@ -453,8 +453,10 @@ function get_bgm_items($page = 1){ } $lists = $bgm["list"]; foreach ((array)$lists as $list) { - preg_match('/看到第(\d+)话/m',$list['progress'], $matches); - $progress = is_numeric($matches[1]) ? $matches[1] : 0; + 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']; $html .= '
@@ -476,5 +478,5 @@ function get_bgm_items($page = 1){ function bgm_bilibili(){ $page = $_GET["page"] ?: 2; $html = preg_replace("/\s+|\n+|\r/", ' ', get_bgm_items($page)); - echo $html; + return $response = new WP_REST_Response($html,200); } \ No newline at end of file diff --git a/js/sakura-app.js b/js/sakura-app.js index 1d232c7..23f1e2e 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -1020,8 +1020,9 @@ function load_bangumi() { xhr.open('POST', this.href, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { + var html = JSON.parse(xhr.responseText); $("#bangumi-pagination").remove(); - $(".row").append(xhr.responseText); + $(".row").append(html); } }; xhr.send(); diff --git a/style.css b/style.css index ea552d9..d4e6952 100644 --- a/style.css +++ b/style.css @@ -8771,6 +8771,7 @@ h1[id*=toc-head]::before,h2[id*=toc-head]::before,h3[id*=toc-head]::before,h4[id } .bangumi-next{ + font-family: sans-serif; color: #e67474; position: relative; padding: 13px 35px;