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

OFF-1457 add compactHeight and standardHeight #3933

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 23 additions & 1 deletion adapters/flipp/flipp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ const (
inlineDivName = "inline"
flippBidder = "flipp"
defaultCurrency = "USD"
defaultStandardHeight int64 = 2400
defaultCompactHeight int64 = 600
)

var (
count int64 = 1
adTypes = []int64{4309, 641}
dtxTypes = []int64{5061}
defaultHeight int64
flippExtParams openrtb_ext.ImpExtFlipp
key string
)

type adapter struct {
Expand Down Expand Up @@ -230,7 +235,24 @@ func buildBid(decision *InlineModel, impId string) *openrtb2.Bid {
if decision.Contents[0].Data.Width != 0 {
bid.W = decision.Contents[0].Data.Width
}
bid.H = 0
customDataInterface := decision.Contents[0].Data.CustomData
customDataMap, ok := customDataInterface.(map[string]interface{})
if flippExtParams.Options.StartCompact {
defaultHeight = defaultCompactHeight
} else {
defaultHeight = defaultStandardHeight
}
bid.H = defaultHeight
if ok { // customDataMap exists
if flippExtParams.Options.StartCompact {
key = "compactHeight"
} else {
key = "standardHeight"
}
if height, exists := customDataMap[key].(int64); exists {
bid.H = height
}
}
}
return bid
}
Expand Down
Loading