Skip to content

Commit

Permalink
Improve calculateAdTypeAsString
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen-Veltmans committed Dec 10, 2024
1 parent 03c08f2 commit 851e9fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,7 @@ class AdReporter(
// - `c3.csid`: the content’s sessionID;
// - `contentAssetName`: the content's assetName.
val contentAssetName = convivaHandler.contentAssetName
val adTechnology =
if (ad.integration == AdIntegrationKind.THEO_ADS) "Server Guided" else calculateAdTypeAsString(
ad
)
val adTechnology = calculateAdTypeAsString(ad)
var adMetadata = collectAdMetadata(ad) + mapOf(
"c3.csid" to convivaVideoAnalytics.sessionId.toString(),
"contentAssetName" to contentAssetName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ fun calculateAdType(adBreak: AdBreak): ConvivaSdkConstants.AdType {
}

fun calculateAdTypeAsString(ad: Ad): String {
if (ad.integration == AdIntegrationKind.THEO_ADS) {
return "Server Guided"
}
return when (calculateAdType(ad)) {
ConvivaSdkConstants.AdType.SERVER_SIDE -> "Server Side"
ConvivaSdkConstants.AdType.CLIENT_SIDE -> "Client Side"
Expand Down

0 comments on commit 851e9fc

Please sign in to comment.