feat(sports): One list across leagues, Live Now first #27
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sports-rethink"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's wrong
Sports lists ESPN's scoreboards, and pressing OK on a game opened a picker of the user's channels that carry it. That press took seconds. The picker matched the game against every channel the provider lists (about 8,600) and their guide listings, on the thread that draws the screen. On the emulator that froze the app for 1.7 seconds, and a TV box is several times slower. After a cold start it also waited for the full channel list and the ~64 MB guide to download.
The result was noisy, too. For Bears @ Seahawks the picker listed about 40 channels. The streams made for that game ("NFL GAME 01 : MNF CHICAGO BEARS @ SEATTLE…") came after about 20 ESPN feeds.
The IPTV pool, the provider this app is mostly used with, combines several providers' streams. It has a Live Now category: one channel per live event, which switches to another provider's stream if one drops. Sports never looked at it.
Standings were a second view Gabriel asked to drop, and each league switch downloaded them.
What changed
Sports is now one list of every league's games. It follows the Option A mockup Gabriel picked over a list-and-preview layout (
design/mockups/bgrid/sports/a-*.png).All the matching happens in the background while the list is on screen:
ChannelMatcher(new,feature/sports/data) prepares the channels and guide once and indexes them by word. It then scores only the channels a game could be on. The scoring rules moved there unchanged fromSportsRepository, whosematchChannelsnow wraps it, so the existing matcher tests still cover them.tokenizeare compiled once instead of on every call.Other files:
SportsListholds the list rules.PendingSearchhands the query to Search.LiveChannelCache.cachedandProviderRepository.cachedLiveChannelsread the channel list without loading it.SearchViewModelbuilds the same matcher once for its own game picker, so its picker results are unchanged but it no longer re-prepares them on each open.SearchScreenruns a handed-over query and focuses its results.LiveWireNavHostpasses Sports a way to open Search.README.mdis updated.Not a goal: changing how channel matches are ranked against each other, or the README's Sports screenshot. That screenshot (
docs/images/sports.jpg) still shows the old screen, and I'll redo it with the demo provider separately.Checks
testDebugUnitTest: 563 pass. 20 are new: 19 inSportsListTest, and one inSportsMatchTestchecking that a single matcher serves several games.lintDebug: 0 errors, 14 warnings, none in changed files.assembleDebug: OK.Screenshots
I'll add these in a comment:
Intent: pressing OK on a game in Sports plays it straight away, from the pool's Live Now channel when there is one. Every league's games are in one list, and Standings are gone.
Not a goal: changing how channel matches rank against each other, Search's own results, or the README's Sports screenshot (separate change).
Review focus:
ChannelMatcherpicks candidates. It must never drop a channel the old full scan would have matched, and the existingSportsMatchTestcases pin that down.