Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Consumable: Correct bid type, should always be "banner". (prebid#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy authored Jun 17, 2020
1 parent 046bc66 commit c50377c
Showing 1 changed file with 5 additions and 12 deletions.
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,
})
}
}
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

0 comments on commit c50377c

Please sign in to comment.