From 2e90ed1acb2ed4b1d7e78b28d46c5cdf6420927a Mon Sep 17 00:00:00 2001 From: Michael Burns Date: Thu, 6 May 2021 13:44:25 -0400 Subject: [PATCH] IX: Set category in bid.cat (#1837) --- 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..5e10138f8f3 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 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)