Fix median condition not working when the number of filler videos in a channel is odd.
This commit is contained in:
parent
447c33027b
commit
a8cdc6f449
@ -345,8 +345,9 @@ function getMedian(channelCache, channel, fillers) {
|
||||
if (times.length == 0) {
|
||||
return null;
|
||||
}
|
||||
quickselect(times, times.length / 2)
|
||||
return times[times.length / 2];
|
||||
let m = Math.floor(times.length / 2);
|
||||
quickselect(times, m)
|
||||
return times[m];
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user