mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-21 14:18:14 +02:00
feat: add XtreamServiceMobile for Xtream Codes API communication with caching and DNS resolution for mobile.
This commit is contained in:
1 parent
80320d0eae
commit
5dd83019d3
8 files changed
+107
-177
No files matched your search
+3
-13
@@ -7,6 +7,7 @@ import 'core/providers/theme_provider.dart';
|
||||
import 'mobile/features/iptv/screens/mobile_playlist_screen.dart';
|
||||
import 'mobile/features/iptv/screens/mobile_dashboard_screen.dart';
|
||||
import 'core/models/playlist_config.dart';
|
||||
import 'core/database/hive_service.dart';
|
||||
|
||||
/// Mobile-optimized entry point for XtremFlow IPTV
|
||||
/// No authentication - direct access to playlist selection
|
||||
@@ -16,29 +17,18 @@ void main() async {
|
||||
// Initialize MediaKit (required for video playback)
|
||||
MediaKit.ensureInitialized();
|
||||
|
||||
// Initialize Hive for local storage
|
||||
await Hive.initFlutter();
|
||||
// Initialize Hive (Centralized)
|
||||
await HiveService.init();
|
||||
|
||||
// CLEAR CACHE ON STARTUP (Requested by User)
|
||||
try {
|
||||
// Clear API/EPG Cache (using default box name 'dio_cache')
|
||||
await Hive.deleteBoxFromDisk('dio_cache');
|
||||
debugPrint('XtremFlow: API Cache cleared');
|
||||
|
||||
// Clear Image Cache (if using cached_network_image)
|
||||
// Note: flutter_cache_manager needs to be imported if used explicitly,
|
||||
// but typically it manages itself. If we want to force clear:
|
||||
// await DefaultCacheManager().emptyCache();
|
||||
// Since we didn't add the import yet, we'll stick to Hive for now as that handles EPG/API.
|
||||
} catch (e) {
|
||||
debugPrint('XtremFlow: Failed to clear cache: $e');
|
||||
}
|
||||
|
||||
// Register adapters for Hive
|
||||
if (!Hive.isAdapterRegistered(1)) {
|
||||
Hive.registerAdapter(PlaylistConfigAdapter());
|
||||
}
|
||||
|
||||
runApp(const ProviderScope(child: MobileApp()));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user