Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<label for="enable-video-data">显示视频数据:</label>
<input type="checkbox" id="enable-video-data">
</div>
<div class="item">
<label for="max-page-count">最多搜索的视频页数(1页50视频):</label>
<input type="number" id="max-page-count">
</div>
<div class="item">
<label for="enable-word-cloud">使用词云:</label>
<input type="checkbox" id="enable-word-cloud">
Expand Down
1 change: 1 addition & 0 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const all_options = [
['enable-tag-color', null, true],
['enable-ip-label', null, true],
['enable-video-data', null, true],
['max-page-count', null, null],
['min-number', 'minSize', 5],
]

Expand Down
14 changes: 11 additions & 3 deletions scripts/biliapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,17 @@ function updateVideoData(userId, callback) {

let pn = 1;
let promises = [];
while (pn * NUM_PER_PAGE < count) {
pn += 1;
promises.push(requestSearchPage(userId, pn, map));
if (biliScopeOptions.maxPageCount === null) {
while (pn * NUM_PER_PAGE < count) {
pn += 1;
promises.push(requestSearchPage(userId, pn, map));
}
}
else {
while (pn * NUM_PER_PAGE < count && pn < biliScopeOptions.maxPageCount) {
pn += 1;
promises.push(requestSearchPage(userId, pn, map));
}
}
Promise.all(promises).then((values) => {
cacheAndUpdate(callback, userId, "wordcloud", convertVideoData(map));
Expand Down
1 change: 1 addition & 0 deletions scripts/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function loadOptions() {
aiSummaryHoverThreshold: 800,
enableVideoTag: true,
enableVideoData: true,
maxPageCount: null,
enableIpLabel: true,
minSize: 5
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function getUserProfileCardDataHTML(data) {
<span class="idc-meta-item"><data-title>上次投稿</data-title> ${timestampToDisplay(data["lastVideoTimestamp"])}</span>
</div>
<div class="idc-meta" style="${data["count"] ? "": "display: none"}">
<span class="idc-meta-item"><data-title>平均稿件长度</data-title> ${secondsToDisplay(data["totalVideoLength"] / data["count"])}</span>
<span class="idc-meta-item"><data-title>平均稿件长度</data-title> ${secondsToDisplay(data["totalVideoLength"] / (data["count"] > biliScopeOptions.maxPageCount * NUM_PER_PAGE && biliScopeOptions.maxPageCount * NUM_PER_PAGE !== null ? biliScopeOptions.maxPageCount * NUM_PER_PAGE: data["count"]))}</span>
</div>
</div>
<div id="biliscope-tag-list">
Expand Down