Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IX: Set category in bid.cat #1837

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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