Skip to content

Commit

Permalink
Update to move floors logic after placement.sizes are defined (#8476)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoschovas authored May 26, 2022
1 parent 8aaf01b commit 5882444
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const spec = {

for (let i = 0; i < validBidRequests.length; i++) {
let bid = validBidRequests[i];
let traff = bid.params.traffic || BANNER
let traff = bid.params.traffic || BANNER;
let placement = {
placementId: bid.params.placement_id,
groupId: bid.params.group_id,
Expand All @@ -116,19 +116,7 @@ export const spec = {
eids: [],
floor: {}
};
if (typeof bid.getFloor === 'function') {
let tmpFloor = {};
for (let size of placement.sizes) {
tmpFloor = bid.getFloor({
currency: 'USD',
mediaType: traff,
size: size
});
if (tmpFloor) {
placement.floor[`${size[0]}x${size[1]}`] = tmpFloor.floor;
}
}
}

if (bid.schain) {
placement.schain = bid.schain;
}
Expand All @@ -147,9 +135,7 @@ export const spec = {
}
if (traff === BANNER) {
placement.sizes = bid.mediaTypes[BANNER].sizes
}

if (traff === VIDEO) {
} else if (traff === VIDEO) {
placement.sizes = bid.mediaTypes[VIDEO].playerSize;
placement.playerSize = bid.mediaTypes[VIDEO].playerSize;
placement.minduration = bid.mediaTypes[VIDEO].minduration;
Expand All @@ -167,6 +153,20 @@ export const spec = {
placement.api = bid.mediaTypes[VIDEO].api;
placement.linearity = bid.mediaTypes[VIDEO].linearity;
}
if (typeof bid.getFloor === 'function') {
let tmpFloor = {};
for (let size of placement.sizes) {
tmpFloor = bid.getFloor({
currency: 'USD',
mediaType: traff,
size: size
});
if (tmpFloor) {
placement.floor[`${size[0]}x${size[1]}`] = tmpFloor.floor;
}
}
}

placements.push(placement);
}
return {
Expand Down

0 comments on commit 5882444

Please sign in to comment.