Fix locked segment filtering for highlight and full video

This commit is contained in:
Ajay 2022-01-06 14:54:27 -05:00
parent d5d73273de
commit be441a314f
2 changed files with 5 additions and 0 deletions

View file

@ -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

View file

@ -85,6 +85,7 @@ export interface OverlappingSegmentGroup {
export interface VotableObject {
votes: number;
reputation: number;
locked: boolean;
}
export interface VotableObjectWithWeight extends VotableObject {