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

HuaweiAds: Fixing the fill rate issue #3219

Merged
merged 6 commits into from
Oct 19, 2023
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
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
Loading