Skip to content

Commit d071294

Browse files
mlb7687shunj-nb
authored andcommitted
IX: Set category in bid.cat (prebid#1837)
1 parent 99d2a71 commit d071294

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

adapters/ix/ix.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ func (a *IxAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalReque
409409
unmarshalExtErr := json.Unmarshal(bid.Ext, &bidExt)
410410
if unmarshalExtErr == nil && bidExt.Prebid != nil && bidExt.Prebid.Video != nil {
411411
bidExtVideo = &openrtb_ext.ExtBidPrebidVideo{
412-
Duration: bidExt.Prebid.Video.Duration,
413-
PrimaryCategory: bidExt.Prebid.Video.PrimaryCategory,
412+
Duration: bidExt.Prebid.Video.Duration,
413+
}
414+
if len(bid.Cat) == 0 {
415+
bid.Cat = []string{bidExt.Prebid.Video.PrimaryCategory}
414416
}
415417
}
416418
}

adapters/ix/ix_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,8 @@ func TestIxMakeBidsWithCategoryDuration(t *testing.T) {
792792
if bidResponse.Bids[0].BidVideo.Duration != expectedBidDuration {
793793
t.Errorf("video duration should be set")
794794
}
795-
if bidResponse.Bids[0].BidVideo.PrimaryCategory != expectedBidCategory {
796-
t.Errorf("video category should be set")
795+
if bidResponse.Bids[0].Bid.Cat[0] != expectedBidCategory {
796+
t.Errorf("bid category should be set")
797797
}
798798
if len(errors) != expectedErrorCount {
799799
t.Errorf("should not have any errors, errors=%v", errors)

0 commit comments

Comments
 (0)