Improve personalization for DailyMix and YourMix playlists#294
Improve personalization for DailyMix and YourMix playlists#294theovilardo merged 2 commits intomasterfrom
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 legacyType = object : com.google.gson.reflect.TypeToken<MutableMap<String, Int>>() {}.type | ||
| val legacyMap: MutableMap<String, Int> = gson.fromJson(jsonText, legacyType) ?: mutableMapOf() | ||
| legacyMap.mapValuesTo(mutableMapOf()) { (playCount) -> | ||
| SongEngagementStats(playCount = playCount) |
There was a problem hiding this comment.
Fix legacy engagement migration lambda type
When converting legacy song_scores.json data, the lambda passed to legacyMap.mapValuesTo takes a Map.Entry but assigns it directly to SongEngagementStats(playCount = playCount). Because playCount here is the entire entry, not the integer value, this code will not compile (MutableMap.MutableEntry<String, Int> cannot be assigned to an Int). Destructure the entry ({ (_, count) -> … }) or use it.value so the builder receives the actual play count.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68fafc689e10832fb9f8ad94290554ba