Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fun updateAdMetadataForGoogleIma(ad: GoogleImaAd, metadata: ConvivaMetadata): Co
fun collectAdMetadata(ad: Ad): ConvivaMetadata {
// AssetName should never be an empty string
return mutableMapOf(
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.duration else 0,
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.durationAsDouble else 0.0,
Copy link
Contributor

@MattiasBuelens MattiasBuelens Jul 1, 2025

Choose a reason for hiding this comment

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

A little bit more idiomatic perhaps:

Suggested change
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.durationAsDouble else 0.0,
ConvivaSdkConstants.DURATION to (ad as? LinearAd)?.durationAsDouble ?? 0.0,

ConvivaSdkConstants.ASSET_NAME to ad.id,

// [Required] This Ad ID is from the Ad Server that actually has the ad creative.
Expand Down
Loading