Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumable: Correct bid type, should always be "banner". #1359

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions adapters/consumable/consumable.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ func (a *ConsumableAdapter) MakeBids(
//bid.referrer = utils.getTopWindowUrl();

bidderResponse.Bids = append(bidderResponse.Bids, &adapters.TypedBid{
Bid: &bid,
BidType: getMediaTypeForImp(getImp(bid.ImpID, internalRequest.Imp)),
Bid: &bid,
// Consumable units are always HTML, never VAST.
// From Prebid's point of view, this means that Consumable units
// are always "banners".
BidType: openrtb_ext.BidTypeBanner,
djcsdy marked this conversation as resolved.
Show resolved Hide resolved
})
}
}
Expand Down Expand Up @@ -303,16 +306,6 @@ func extractExtensions(impression openrtb.Imp) (*adapters.ExtImpBidder, *openrtb
return &bidderExt, &consumableExt, nil
}

func getMediaTypeForImp(imp *openrtb.Imp) openrtb_ext.BidType {
// TODO: Whatever logic we need here possibly as follows - may always be Video when we bid
if imp.Banner != nil {
return openrtb_ext.BidTypeBanner
} else if imp.Video != nil {
return openrtb_ext.BidTypeVideo
}
return openrtb_ext.BidTypeVideo
}

func testConsumableBidder(testClock instant, endpoint string) *ConsumableAdapter {
return &ConsumableAdapter{testClock, endpoint}
}
Expand Down