Skip to content

Commit

Permalink
HuaweiAds: Fixing the fill rate issue (prebid#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetfaruk59 authored and svamiftah committed Nov 21, 2023
1 parent 73bd52c commit dfa7fa7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion adapters/huaweiads/huaweiads.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ func getNativeFormat(adslot30 *adslot30, openRTBImp *openrtb2.Imp) error {
// only compute the main image number, type = native1.ImageAssetTypeMain
var numMainImage = 0
var numVideo = 0

var width int64
var height int64
for _, asset := range nativePayload.Assets {
// Only one of the {title,img,video,data} objects should be present in each object.
if asset.Video != nil {
Expand All @@ -547,10 +548,19 @@ func getNativeFormat(adslot30 *adslot30, openRTBImp *openrtb2.Imp) error {
if asset.Img != nil {
if asset.Img.Type == native1.ImageAssetTypeMain {
numMainImage++
if asset.Img.H != 0 && asset.Img.W != 0 {
width = asset.Img.W
height = asset.Img.H
} else if asset.Img.WMin != 0 && asset.Img.HMin != 0 {
width = asset.Img.WMin
height = asset.Img.HMin
}
}
continue
}
}
adslot30.W = width
adslot30.H = height

var detailedCreativeTypeList = make([]string, 0, 2)
if numVideo >= 1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
"detailedCreativeTypeList": [
"903"
],
"h": 200,
"w": 200,
"test": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"detailedCreativeTypeList": [
"901"
],
"h": 200,
"w": 200,
"test": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
"detailedCreativeTypeList": [
"904"
],
"h": 200,
"w": 200,
"test": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"detailedCreativeTypeList": [
"904"
],
"h": 200,
"w": 200,
"test": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
"test": 1,
"detailedCreativeTypeList": [
"903"
]
],
"h": 200,
"w": 200
}
],
"device": {
Expand Down

0 comments on commit dfa7fa7

Please sign in to comment.