Fix median condition not working when the number of filler videos in a channel is odd.

This commit is contained in:
vexorian 2023-11-21 14:37:45 -04:00
parent 447c33027b
commit a8cdc6f449

View File

@ -345,8 +345,9 @@ function getMedian(channelCache, channel, fillers) {
if (times.length == 0) { if (times.length == 0) {
return null; return null;
} }
quickselect(times, times.length / 2) let m = Math.floor(times.length / 2);
return times[times.length / 2]; quickselect(times, m)
return times[m];
} }