From 53f74b094756c67deb56d659603cbbd5cba971c8 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Tue, 4 May 2021 11:30:07 -0400 Subject: [PATCH 1/2] Set IX category in bid.cat --- adapters/ix/ix.go | 6 ++++-- adapters/ix/ix_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/adapters/ix/ix.go b/adapters/ix/ix.go index f8903008328..1f5827221fc 100644 --- a/adapters/ix/ix.go +++ b/adapters/ix/ix.go @@ -409,8 +409,10 @@ func (a *IxAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalReque unmarshalExtErr := json.Unmarshal(bid.Ext, &bidExt) if unmarshalExtErr == nil && bidExt.Prebid != nil && bidExt.Prebid.Video != nil { bidExtVideo = &openrtb_ext.ExtBidPrebidVideo{ - Duration: bidExt.Prebid.Video.Duration, - PrimaryCategory: bidExt.Prebid.Video.PrimaryCategory, + Duration: bidExt.Prebid.Video.Duration, + } + if bid.Cat == nil || len(bid.Cat) == 0 { + bid.Cat = []string{bidExt.Prebid.Video.PrimaryCategory} } } } diff --git a/adapters/ix/ix_test.go b/adapters/ix/ix_test.go index bc70f3999df..d292273a92c 100644 --- a/adapters/ix/ix_test.go +++ b/adapters/ix/ix_test.go @@ -792,8 +792,8 @@ func TestIxMakeBidsWithCategoryDuration(t *testing.T) { if bidResponse.Bids[0].BidVideo.Duration != expectedBidDuration { t.Errorf("video duration should be set") } - if bidResponse.Bids[0].BidVideo.PrimaryCategory != expectedBidCategory { - t.Errorf("video category should be set") + if bidResponse.Bids[0].Bid.Cat[0] != expectedBidCategory { + t.Errorf("bid category should be set") } if len(errors) != expectedErrorCount { t.Errorf("should not have any errors, errors=%v", errors) From 784fc56aaafc37a4f81a39b2104d34bc96261007 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Thu, 6 May 2021 11:34:14 -0400 Subject: [PATCH 2/2] Remove redundant check --- adapters/ix/ix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/ix/ix.go b/adapters/ix/ix.go index 1f5827221fc..5e10138f8f3 100644 --- a/adapters/ix/ix.go +++ b/adapters/ix/ix.go @@ -411,7 +411,7 @@ func (a *IxAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalReque bidExtVideo = &openrtb_ext.ExtBidPrebidVideo{ Duration: bidExt.Prebid.Video.Duration, } - if bid.Cat == nil || len(bid.Cat) == 0 { + if len(bid.Cat) == 0 { bid.Cat = []string{bidExt.Prebid.Video.PrimaryCategory} } }