modules/freeWheelAdserverVideo.js
function getExclusiveBids(bidsReceived) {
  let bids = bidsReceived
    .map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
  bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
  let filteredBids = [];
  Object.keys(bids).forEach((targetingKey) => {
    bids[targetingKey].sort(compareOn('responseTimestamp'));
    filteredBids.push(bids[targetingKey][0]);
  });
  return filteredBids;
}
function getExclusiveBids(bidsReceived) {
  let bids = bidsReceived
    .map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
  bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
  let filteredBids = [];
  Object.keys(bids).forEach((targetingKey) => {
    bids[targetingKey].sort(compareOn('responseTimestamp'));
    filteredBids.push(bids[targetingKey][0]);
  });
  return filteredBids;
}
function getExclusiveBids ( bidsReceived ) { let bids = bidsReceived . map ( ( bid ) => Object . assign ( { } , bid , { [ TARGETING_KEY_PB_CAT_DUR ] : bid . adserverTargeting [ TARGETING_KEY_PB_CAT_DUR ] } ) ) ; bids = groupBy ( bids , TARGETING_KEY_PB_CAT_DUR ) ; let filteredBids = [ ] ; Object . keys ( bids ) . forEach ( ( targetingKey ) => { bids [ targetingKey ] . sort ( compareOn ( 'responseTimestamp' ) ) ; filteredBids . push ( bids [ targetingKey ] [ 0 ] ) ; } ) ; return filteredBids ; }
This function removes bids of same freewheel category. It will be used when competitive exclusion is enabled.
@param {Array[Object]} bidsReceived
@returns {Array[Object]} unique freewheel category bids
This function removes bids of same freewheel category . It will be used when competitive exclusion is enabled .