Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val effectiveStart = startBound | ||
| ?: filteredEvents.minOfOrNull { it.timestamp } | ||
| ?: allEvents.minOfOrNull { it.timestamp } | ||
| val effectiveEnd = filteredEvents.maxOfOrNull { it.timestamp } ?: endBound |
There was a problem hiding this comment.
Average listening time ignores inactive days in range
The averageDailyDurationMs shown in the stats UI is computed using effectiveEnd, which is assigned to the last event timestamp when there are any plays. As a result, the subsequent calculation divides the total duration by only the days between the first and last played days instead of the full selected time range (e.g., a week or month). If a user listens only on Monday and then stops for the rest of the week, the code will divide by one day and display an inflated “Avg per day” even though the screen labels the range as “This Week”. Consider deriving the day span from startBound/endBound (the actual range boundaries) so inactive days inside the selected range are accounted for.
Useful? React with 👍 / 👎.
Summary
Testing
./gradlew :app:compileDebugKotlin(fails: Android SDK not available in CI environment)https://chatgpt.com/codex/tasks/task_e_68fbcef32134832f9cd4f9c50d012345