-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Update Media Content Time Spent Calculations with Ad Breaks #74
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
feat: Update Media Content Time Spent Calculations with Ad Breaks #74
Conversation
|
nickolas-dimitrakas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jamesnrokt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran tests locally as there's no test steps on this repo, would be good to add as a verification step but if time pressured then LGTM
| mediaSession.logAdBreakStart { | ||
| id = "break-2" | ||
| } | ||
| Thread.sleep(1000) // should count toward content time when flag disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be enabled since it's true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why didn't this comment stop the PR? this test is indeed asserting the opposite of what it should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually added this comment after it was merged.
| } | ||
|
|
||
| private fun pauseContentTimeIfAdBreakExclusionEnabled() { | ||
| if (!excludeAdBreaksFromContentTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this logic inverted?
| streamType = builder.streamType.require("streamType") | ||
| logMPEvents = builder.logMPEvents | ||
| logMediaEvents = builder.logMediaEvents | ||
| this.excludeAdBreaksFromContentTime = builder.excludeAdBreaksFromContentTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you have a different public and private way of describing the same thing? you use the word "exclude" here and "pause" in the public. that leads to confusion and perhaps even led to the bug noted below?
| mediaSession.logPause() | ||
|
|
||
| val contentTime = mediaSession.mediaContentTimeSpent | ||
| assertEquals(2.0, contentTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and any other asserts are going to be flakey. you can't guarantee the code is going to run for exactly this long.
| mediaSession.logAdBreakStart { | ||
| id = "break-2" | ||
| } | ||
| Thread.sleep(1000) // should count toward content time when flag disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why didn't this comment stop the PR? this test is indeed asserting the opposite of what it should be.
## [1.7.0](v1.6.0...v1.7.0) (2025-12-12) ### Features * Update Media Content Time Spent Calculations with Ad Breaks ([#74](#74)) ([c455557](c455557)) ### Bug Fixes * adjust ad break exclusion logic ([#76](#76)) ([84b1493](84b1493)) ### Updates & Maintenance * Migrate from OSSRH to Central Publishing Portal ([#75](#75)) ([ac8de37](ac8de37))
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



Instructions
Summary
Testing Plan
Reference Issue