mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-20 21:59:03 +02:00
feat: Implement MobileLiveTVTab for displaying live IPTV channels with search, categories, and favorites.
This commit is contained in:
1 parent
c2961ef7b9
commit
57ced00738
4 files changed
+109
-74
No files matched your search
@@ -36,8 +36,20 @@ class XtreamServiceMobile {
|
||||
_cacheOptions = CacheOptions(
|
||||
store: _cacheStore,
|
||||
policy: CachePolicy.forceCache,
|
||||
maxStale: const Duration(hours: 24), // Cache for 24h as requested
|
||||
maxStale: const Duration(hours: 24),
|
||||
priority: CachePriority.high,
|
||||
keyBuilder: (request) {
|
||||
// Use the Original Host header if available to generate a stable cache key
|
||||
// regardless of the resolved IP address used for the connection
|
||||
if (request.headers.containsKey('Host')) {
|
||||
final host = request.headers['Host'] as String;
|
||||
final uri = request.uri;
|
||||
// Reconstruct URI with the original hostname
|
||||
final stableUri = uri.replace(host: host);
|
||||
return stableUri.toString();
|
||||
}
|
||||
return request.uri.toString();
|
||||
},
|
||||
);
|
||||
|
||||
_dio.interceptors.add(DioCacheInterceptor(options: _cacheOptions));
|
||||
|
||||
Reference in new issue
Block a user