Skip to content

Commit

Permalink
adjust drop default options
Browse files Browse the repository at this point in the history
  • Loading branch information
xmcp committed May 26, 2024
1 parent 86db036 commit 43e1a76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pakkujs/core/post_combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export function post_combine(input: DanmuClusterOutput, prev_input: DanmuCluster
if(config.DROP_THRESHOLD>0 && onscreen_dispval>config.DROP_THRESHOLD) {
if(c.peers.length===1 && c.peers[0].weight===1) {
let drop_rate = (onscreen_dispval - config.DROP_THRESHOLD) / config.DROP_THRESHOLD;
if (Math.random() < drop_rate)
if (drop_rate>1 || Math.random()<drop_rate)
continue;
}
}
Expand Down Expand Up @@ -267,7 +267,7 @@ export function post_combine(input: DanmuClusterOutput, prev_input: DanmuCluster
if(config.DROP_THRESHOLD>0 && onscreen_dispval>config.DROP_THRESHOLD) {
if(dm.pakku.peers.length<=1 && dm.weight===1) {
let drop_rate = (onscreen_dispval - config.DROP_THRESHOLD) / config.DROP_THRESHOLD;
if(Math.random() < drop_rate) {
if(drop_rate>1 || Math.random()<drop_rate) {
stats.deleted_dispval++;
dm.weight = WEIGHT_DROPPED;
continue;
Expand Down
6 changes: 3 additions & 3 deletions pakkujs/page/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@
<label for="drop-threshold">自动弹幕优选</label>
<select id="drop-threshold">
<option value="0">禁用</option>
<option value="180">轻微 (>180)</option>
<option value="120">中等 (>120)</option>
<option value="80">强力 (>80)</option>
<option value="150">轻微 (>150)</option>
<option value="100">中等 (>100)</option>
<option value="70">强力 (>70)</option>
<option class="other"></option>
</select>
<label for="drop-threshold"></label>
Expand Down

0 comments on commit 43e1a76

Please sign in to comment.