Skip to content

Commit

Permalink
IX: Set category in bid.cat (prebid#1837)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlb7687 authored and sachin-pubmatic committed Aug 2, 2021
1 parent ea536ec commit 2e90ed1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions adapters/ix/ix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions adapters/ix/ix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e90ed1

Please sign in to comment.