From 68eca80e5f4e1326f20440d901c0c1efeba963fe Mon Sep 17 00:00:00 2001 From: gdjdkid <67935269+gdjdkid@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:34:21 +0800 Subject: [PATCH] feat: Added fields to display the number of people who rated and the number of people who wanted to see the content. --- lib/display.js | 2 ++ lib/fetcher.js | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/display.js b/lib/display.js index a9b5fbf..c0ec373 100644 --- a/lib/display.js +++ b/lib/display.js @@ -37,6 +37,8 @@ export function display(info, raw = false) { row('发行商', info.label); row('导演', info.director); row('系列', info.series); + row('评分', info.score ? `${info.score}${info.scoreCount ? `(${info.scoreCount}人评价)` : ''}` : '', chalk.yellow); + row('想看', info.wantCount ? `${info.wantCount} 人想看` : '', chalk.cyan); if (info.tags.length > 0) { const tagStr = info.tags.map(t => chalk.bgGray(` ${t} `)).join(' '); diff --git a/lib/fetcher.js b/lib/fetcher.js index c2e5ba2..a6666e4 100644 --- a/lib/fetcher.js +++ b/lib/fetcher.js @@ -279,6 +279,8 @@ function parseJavdb(html, queryId) { tags: [], coverUrl: $('.video-cover img').attr('src') || '', score: $('.score .value').first().text().trim(), + scoreCount: ($('.score .value').first().text().match(/由(\d+)人/) || [])[1] || '', + wantCount: ($('.panel-block:last .is-size-7').text().match(/(\d+)人想看/) || [])[1] || '', }; $('.movie-panel-info .panel-block').each((_, el) => { diff --git a/package-lock.json b/package-lock.json index a0505d2..5665df7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "javdict", - "version": "1.2.11", + "version": "1.2.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "javdict", - "version": "1.2.11", + "version": "1.2.12", "license": "MIT", "dependencies": { "axios": "^1.6.0", diff --git a/package.json b/package.json index 98b3faa..5a1610a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "javdict", - "version": "1.2.11", + "version": "1.2.12", "description": "AV番号命令行查询工具", "main": "./index.js", "type": "module",