1 Commits

Author SHA1 Message Date
factory-droid[bot]
3e1a9768d8 feat: Integrate WebView players with API server and add comprehensive mock tests
WebView Player Integration:
- Create PlayerEmbedService for API server integration
- Update WebView players to use server embed URLs instead of direct links
- Add fallback to direct URLs when server is unavailable
- Support for both Vibix and Alloha players with server API
- Include optional parameters (imdbId, season, episode) for TV shows
- Add health check endpoint for server availability

Mock Testing Infrastructure:
- Add comprehensive TorrentPlatformService tests with mock platform channel
- Test all torrent operations without requiring real Android engine
- Mock platform channel responses for addTorrent, removeTorrent, pauseTorrent, resumeTorrent
- Test error handling with PlatformException simulation
- Validate torrent state detection (downloading, seeding, completed)
- Test file priority management and video file detection

PlayerEmbedService Testing:
- Mock HTTP client tests for Vibix and Alloha embed URL generation
- Test server API integration with success and failure scenarios
- Validate URL encoding for special characters and non-ASCII titles
- Test fallback behavior when server is unavailable or times out
- Mock player configuration retrieval from server
- Test server health check functionality

Test Dependencies:
- Add http_mock_adapter for HTTP testing
- Ensure all tests work without real Flutter/Android environment
- Support for testing platform channels and HTTP services

This enables proper API server integration for WebView players
while maintaining comprehensive test coverage for all torrent
and player functionality without requiring Android hardware.
2025-10-03 07:16:44 +00:00