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

Conversant: Enable audio requests #3605 #3616

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

przemkaczmarek
Copy link
Collaborator

@przemkaczmarek przemkaczmarek commented Dec 11, 2024

🔧 Type of changes

  • bid adapter update

✨ What's the context?

Adding audio type

🧠 Rationale behind the change

Why did you choose to make these changes? Were there any trade-offs you had to consider?
#3605

Comment on lines 263 to 269
return imps.stream()
.filter(imp -> impId.equals(imp.getId()))
.findFirst()
.map(imp -> imp.getAudio() != null ? BidType.audio
: (imp.getVideo() != null ? BidType.video
: BidType.banner))
.orElse(BidType.banner);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably go this way, because it's closer to the existing bidders style

    private static BidType getType(String impId, List<Imp> imps) {
        for (Imp imp : imps) {
            if (imp.getId().equals(impId)) {
                if (imp.getVideo() != null) {
                    return BidType.video;
                } else if (imp.getAudio() != null) {
                    return BidType.audio;
                } else {
                    return BidType.banner;
                }
            }
        }
        return BidType.banner;
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port PR from PBS-Go: Conversant: Enable audio requests
2 participants