Wholphin/app/src/main/java/com/github/damontecres/wholphin/util
Damontecres 00490b14ec
Improvements to subtitle search & download (#1728)
## Description
Changes to searching & downloading subtitles:
- Activating newly downloaded subtitles more reliably
- Better audio index adjustment checks after downloading subtitles
- Sort subtitle downloadable options by whether the file hash matches
first
- Update the UI for subtitle downloadable options

Also, some improvements to the subtitle choice dialog:
- It now loops from top to bottom (and vice versa)
- It now focuses initially on current choice

### Dev notes
This PR now the selected tracks from `state.currentItemPlayback` to
`state.currentPlayback`. `currentItemPlayback` now only reflects the
user's choices saved in the database instead of a combination of DB and
"actual" state. `currentPlayback` stores the actual, resolved track
indexes regardless of how they were derived.

This means the indexes values in `state.currentItemPlayback` and
`state.currentPlayback` may be different. For example, if the user has
chosen "Only forced", `state.currentItemPlayback==-3` but
`state.currentPlayback` might be an actual forced track index.

### Related issues
Fixes #1549
Fixes #1718
Closes #1723
Fixes bug reported in
https://github.com/damontecres/Wholphin/issues/1498#issuecomment-5019965271

### Testing
Emulator

## Screenshots

Now shows SDH & hash matching

<img width="779" height="280" alt="image"
src="https://github.com/user-attachments/assets/4c33e5af-c9a1-4c9c-8217-6bc2ab3fcd27"
/>

## AI or LLM usage
None
2026-07-23 13:30:43 -04:00
..
mpv Update wholphin-extensions with newer MpvPlayer (#1365) 2026-06-26 12:50:45 -04:00
profile Experimental option to transcode surround sound audio to AC3 (#947) 2026-07-09 13:15:42 -04:00
ApiRequestPager.kt Fix crash on certain grid pages when the app is sent to the background (#1605) 2026-06-20 20:06:34 -04:00
BlockingList.kt Add a lot of code documentation (#1145) 2026-03-29 10:52:25 -04:00
CodecUtils.kt Rebrand 2025-10-15 15:27:30 -04:00
Constants.kt Play or shuffle series, season, collections, & playlists from context menu (#1544) 2026-06-10 19:30:07 -04:00
CoroutineContextApiClient.kt Use Wholphin-specific dispatchers (#1583) 2026-06-18 11:17:19 -04:00
CrashReportSenderFactory.kt Add a lot of code documentation (#1145) 2026-03-29 10:52:25 -04:00
DebugLogTree.kt Add a lot of code documentation (#1145) 2026-03-29 10:52:25 -04:00
DiscoverRequestPager.kt Add filtering & sorting for discover grid pages (#1614) 2026-06-23 17:24:37 -04:00
ExceptionHandler.kt Rebrand 2025-10-15 15:27:30 -04:00
LoadingState.kt Only show view more card if row has more items (#1493) 2026-05-30 17:41:44 -04:00
LocalDateSerializer.kt Add option to remove item from Continue Watching and Next Up rows (#1140) 2026-04-07 16:04:21 -04:00
Media3SubtitleOverride.kt Fix subtitle outline width not applying in release builds (#1687) 2026-07-11 13:21:41 -04:00
RequestPager.kt Use Wholphin-specific dispatchers (#1583) 2026-06-18 11:17:19 -04:00
SearchRelevance.kt Improvements to "Add to playlist" dialog (#1706) 2026-07-16 11:35:48 -04:00
TrackActivityPlaybackListener.kt Improvements to subtitle search & download (#1728) 2026-07-23 13:30:43 -04:00
TrackSupport.kt Improve track selection logic (#1654) 2026-07-10 17:49:47 -04:00
TransformList.kt Add a lot of code documentation (#1145) 2026-03-29 10:52:25 -04:00
Version.kt Several small fixes (#1455) 2026-05-25 13:27:04 -04:00
WholphinDispatchers.kt Use Wholphin-specific dispatchers (#1583) 2026-06-18 11:17:19 -04:00