Skip to content

Commit

Permalink
removing legacy logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaneyama committed Sep 16, 2024
1 parent 73b2411 commit 7c2044a
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions adapters/inmobi/inmobi.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (a *InMobiAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR

for _, sb := range serverBidResponse.SeatBid {
for i := range sb.Bid {
mediaType := getMediaTypeForImp(sb.Bid[i], internalRequest.Imp)
mediaType := getMediaTypeForImp(sb.Bid[i])
bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
Bid: &sb.Bid[i],
BidType: mediaType,
Expand Down Expand Up @@ -118,7 +118,7 @@ func preprocess(imp *openrtb2.Imp) error {
return nil
}

func getMediaTypeForImp(bid openrtb2.Bid, imps []openrtb2.Imp) openrtb_ext.BidType {
func getMediaTypeForImp(bid openrtb2.Bid) openrtb_ext.BidType {
switch bid.MType {
case openrtb2.MarkupBanner:
return openrtb_ext.BidTypeBanner
Expand All @@ -128,18 +128,7 @@ func getMediaTypeForImp(bid openrtb2.Bid, imps []openrtb2.Imp) openrtb_ext.BidTy
return openrtb_ext.BidTypeAudio
case openrtb2.MarkupNative:
return openrtb_ext.BidTypeNative
default:
return openrtb_ext.BidTypeBanner
}
mediaType := openrtb_ext.BidTypeBanner
for _, imp := range imps {
if imp.ID == bid.ImpID {
if imp.Video != nil {
mediaType = openrtb_ext.BidTypeVideo
}
if imp.Native != nil {
mediaType = openrtb_ext.BidTypeNative
}
break
}
}
return mediaType
}

0 comments on commit 7c2044a

Please sign in to comment.