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

Bugfix/missing c4 parameter #50

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .changeset/fresh-turkeys-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theoplayer/nielsen-connector-web": minor
---

Added an optional c4 parameter to `NielsenDCRContentMetadataCZ`.
12 changes: 12 additions & 0 deletions nielsen/src/nielsen/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export type NielsenDCRContentMetadataCZ = NielsenDCRContentMetadata & {
* [LIVE] Keep empty : "nol_c2":"p2,"
*/
c2?: string;
/*
* The actual duration of the live broadcast
* [VOD] Keep empty
* [LIVE] Pass the duration of the live broadcast in seconds
*/
c4?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we have c1, c2 and now c4, is there also a c3 we should add? 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 I thought about this too, but it seems to not be the case:
image

/*
* CMS tag helper item. Indication of whether the content being played supports the insertion of advertisements. “0” – No ads “1” – Supports ads “2” – Don't know (default).
*/
Expand Down Expand Up @@ -162,6 +168,12 @@ export type DCRContentMetadataCZ = DCRContentMetadata & {
* [LIVE] Keep empty : "nol_c2":"p2,"
*/
nol_c2?: string;
/*
* The actual duration of the live broadcast
* [VOD] Keep empty
* [LIVE] Pass the value in seconds as follows "nol_c4" : "p4, value_in_seconds"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-pick: "p4,value_in_seconds" without the space

*/
nol_c4?: string;
/*
* CMS tag helper item. Indication of whether the content being played supports the insertion of advertisements. “0” – No ads “1” – Supports ads “2” – Don't know (default).
*/
Expand Down
5 changes: 3 additions & 2 deletions nielsen/src/utils/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ export function buildDCRContentMetadata(
adloadtype: metadata.adloadtype
};
if (country === NielsenCountry.CZ) {
const { crossId1, segB, segC, c1, c2, hasAds } = metadata as NielsenDCRContentMetadataCZ;
const { crossId1, segB, segC, c1, c2, c4, hasAds } = metadata as NielsenDCRContentMetadataCZ;
const dcrContentMetadataCZ: DCRContentMetadataCZ = {
...dcrContentMetadata,
['crossId1']: crossId1,
['nol_c1']: `p1,${c1 ?? ''}`,
['nol_c2']: `p2,${c2 ?? ''}`,
['nol_c4']: `p4,${c4 ?? ''}`,
segB: segB,
segC: segC ?? '',
hasAds: hasAds
};
if (c1) dcrContentMetadataCZ['nol_c1'] = `p1,${c1}`;
GillesMoris-Dolby marked this conversation as resolved.
Show resolved Hide resolved
return dcrContentMetadataCZ;
}
if (country === NielsenCountry.US) {
Expand Down