Files
neomovies-mobile/lib/presentation
Cursor Agent 185980083a feat: add comprehensive logging for downloads debugging
Added extensive logging throughout DownloadsProvider and DownloadsScreen
to diagnose why downloads screen appears empty.

DownloadsProvider.refreshDownloads():
- 📥 Log function call
- 📥 Log state changes (loading, error)
- 📥 Log TorrentPlatformService.getAllDownloads() call
- 📥 Log number of torrents received
- 📥 Log each torrent processing with index
- 📥 Log success/failure for each torrent info fetch
- 📥 Log final torrents count
- 📥 Log completion or error state

DownloadsScreen.initState() and Consumer:
- 📥 Log initState call
- 📥 Log postFrameCallback execution
- 📥 Log Consumer builder invocations
- 📥 Log provider state (isLoading, error, torrents.length)
- 📥 Log which UI is displayed:
  * CircularProgressIndicator
  * ErrorDisplay
  * Empty state message
  * Torrent list with count

All logs prefixed with 📥 for easy filtering in logcat.

Example output:
---
📥 DownloadsScreen: initState() called
📥 DownloadsScreen: postFrameCallback, calling refreshDownloads()
📥 DownloadsProvider: refreshDownloads() called
📥 Setting loading=true, error=null
📥 Calling TorrentPlatformService.getAllDownloads()...
📥 Got 0 torrents from platform service
📥 Cleared _torrents list
📥 Final torrents count: 0
📥 Setting loading=false
📥  refreshDownloads() completed successfully
📥 DownloadsScreen: Consumer builder called
📥   isLoading: false
📥   error: null
📥   torrents.length: 0
📥   → Showing empty state

This will help identify:
- Is refreshDownloads being called?
- Does TorrentPlatformService return any data?
- Are torrents parsed correctly?
- Is the correct UI state shown?
- Where does the process fail?

Usage:
Run app → Open Downloads screen → Check logcat for 📥 logs
2025-10-05 17:35:07 +00:00
..
2025-10-02 18:28:52 +00:00