mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-15 19:27:41 +02:00
feat: Add generated Hive TypeAdapters for AppUser and PlaylistConfig models, and new build/doctor log files.
This commit is contained in:
1 parent
780f6c1842
commit
ef97c6dc90
81 files changed
+3233
-2428
No files matched your search
@@ -52,6 +52,9 @@ class ApiClient {
|
||||
return _token;
|
||||
}
|
||||
|
||||
/// Get underlying Dio instance for direct use
|
||||
Dio get dio => _dio;
|
||||
|
||||
/// Restore token from SharedPreferences
|
||||
Future<void> restoreToken() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
@@ -139,14 +139,6 @@ class UnifiedDnsService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Clear DNS cache
|
||||
void clearCache() {
|
||||
_cache.clear();
|
||||
if (kDebugMode) {
|
||||
debugPrint('🗑️ DNS cache cleared');
|
||||
}
|
||||
}
|
||||
|
||||
/// Get cache stats for debugging
|
||||
Map<String, dynamic> getCacheStats() {
|
||||
final expiredCount = _cache.values.where((e) => e.isExpired).length;
|
||||
@@ -158,14 +150,22 @@ class UnifiedDnsService {
|
||||
};
|
||||
}
|
||||
|
||||
/// Cache entry with TTL
|
||||
static class _DnsCacheEntry {
|
||||
final String ip;
|
||||
final DateTime timestamp;
|
||||
|
||||
_DnsCacheEntry(this.ip) : timestamp = DateTime.now();
|
||||
|
||||
bool get isExpired =>
|
||||
DateTime.now().difference(timestamp).inSeconds > _cacheTtlSeconds;
|
||||
/// Clear DNS cache
|
||||
void clearCache() {
|
||||
_cache.clear();
|
||||
if (kDebugMode) {
|
||||
debugPrint('🗑️ DNS cache cleared');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Cache entry with TTL
|
||||
class _DnsCacheEntry {
|
||||
final String ip;
|
||||
final DateTime timestamp;
|
||||
|
||||
_DnsCacheEntry(this.ip) : timestamp = DateTime.now();
|
||||
|
||||
bool get isExpired =>
|
||||
DateTime.now().difference(timestamp).inSeconds > 3600;
|
||||
}
|
||||
Reference in new issue
Block a user