mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Fix locked segment filtering for highlight and full video
This commit is contained in:
parent
d5d73273de
commit
be441a314f
2 changed files with 5 additions and 0 deletions
|
@ -183,6 +183,10 @@ function getWeightedRandomChoice<T extends VotableObject>(choices: T[], amountOf
|
|||
const splitArray = partition(choices, predicate);
|
||||
filteredChoices = splitArray[0];
|
||||
forceIncludedChoices = splitArray[1];
|
||||
|
||||
if (filteredChoices.some((value) => value.locked)) {
|
||||
filteredChoices = filteredChoices.filter((value) => value.locked);
|
||||
}
|
||||
}
|
||||
|
||||
//assign a weight to each choice
|
||||
|
|
|
@ -85,6 +85,7 @@ export interface OverlappingSegmentGroup {
|
|||
export interface VotableObject {
|
||||
votes: number;
|
||||
reputation: number;
|
||||
locked: boolean;
|
||||
}
|
||||
|
||||
export interface VotableObjectWithWeight extends VotableObject {
|
||||
|
|
Loading…
Reference in a new issue