bug: ContinueWatchingSelector sorts episodes by string comparison instead of proper date parsing causing wrong resume order
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start in app/src/main/kotlin/com/arflix/tv/util/ContinueWatchingSelector.kt and read selectInProgressEpisode() to see how updatedAt values are selected and what timestamp formats the app supplies. Check for existing tests covering episode selection. Done means the most recently watched in-progress episode is selected correctly when timestamps use different formats or timezone offsets.
Written by the indexing model from the issue text.
Description
🐛 Bug Report
Description
In app/src/main/kotlin/com/arflix/tv/util/ContinueWatchingSelector.kt, the selectInProgressEpisode() function sorts in-progress episodes using .maxByOrNull { it.updatedAt ?: "" }. This compares updatedAt as a plain string instead of parsing it as a date, which can return wrong results when timestamps have different formats or timezones.
Steps to Reproduce
- Open
app/src/main/kotlin/com/arflix/tv/util/ContinueWatchingSelector.kt - Find
selectInProgressEpisode()function - Notice this line:
.maxByOrNull { it.updatedAt ?: "" } - If
updatedAtcontains ISO timestamps like "2026-01-10T10:00:00Z" vs "2025-12-31T23:59:59Z", string comparison works accidentally — but any format variation breaks ordering
Expected Behavior
Episodes should be sorted by properly parsed date/time so the most recently watched episode is always selected correctly regardless of timestamp format.
Actual Behavior
String comparison is used which works accidentally for ISO dates but will silently break if timestamp format ever changes or contains timezone offsets.
Proposed Fix
// Current (fragile string comparison)
.maxByOrNull { it.updatedAt ?: "" }
// Fix (proper date parsing)
.maxByOrNull { snapshot ->
snapshot.updatedAt?.let {
runCatching {
java.time.Instant.parse(it).epochSecond
}.getOrDefault(0L)
} ?: 0L
}
Environment
- Platform: Android TV / Google TV
- Language: Kotlin
Additional Context
Files to modify: app/src/main/kotlin/com/arflix/tv/util/ContinueWatchingSelector.kt
Impact: Medium — affects Continue Watching row accuracy
Effort: Small — single line change
- Dominant language
- Kotlin
- Stars
- 760
- Forks
- 122
- Avg merge
- 15h 3m
- Merged PRs (30d)
- 62
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ProdigyV21/ARVIO
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ProdigyV21/ARVIO#832 · 1 comment ·
Maintainers usually reply within 1 day
-
area: web type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
ProdigyV21/ARVIO#444 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
[FEATURE]: pcOpentype:feature
Difficulty 4/5 3-5 days Newbie friendliness 15/100
ProdigyV21/ARVIO#831 ·
Maintainers usually reply within 1 day
-
type:bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
ProdigyV21/ARVIO#815 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
ProdigyV21/ARVIO#773 ·
Maintainers usually reply within 1 day
All issues in ProdigyV21/ARVIO
Similar issues
-
afk-ok area:frontend size:S
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
enorm-labs/event-junkie#4154 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PixelPlayerHQ/PixelPlayerOSS#193 ·
Maintainers usually reply within 1 day
-
bug web-server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jooby-project/jooby#4035 ·
Maintainers usually reply within 1 day
-
Android: theme prop is ignored in R8-minified release builds (Theme enum is not Enumerable)Possibly taken @1kuko3 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
keiyoushi/extensions-source#20494 · 1 reaction ·
Maintainers usually reply within 1 day