mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-19 13:18:15 +02:00
feat: Add mobile-specific Riverpod providers for Xtream service, live TV, movies, series, and EPG data, along with UI state management.
This commit is contained in:
1 parent
f85f43e42f
commit
e1a0802a0c
18 files changed
+1619
-574
No files matched your search
@@ -321,12 +321,23 @@ class ShortEPG {
|
||||
});
|
||||
|
||||
factory ShortEPG.fromJson(Map<String, dynamic> json) {
|
||||
// Xtream API encodes title and description in Base64
|
||||
String decodeBase64(String? value) {
|
||||
if (value == null || value.isEmpty) return '';
|
||||
try {
|
||||
final bytes = base64.decode(value);
|
||||
return utf8.decode(bytes);
|
||||
} catch (_) {
|
||||
return value; // Return as-is if not valid base64
|
||||
}
|
||||
}
|
||||
|
||||
return ShortEPG(
|
||||
id: json['id']?.toString() ?? '',
|
||||
title: json['title']?.toString() ?? '',
|
||||
title: decodeBase64(json['title']?.toString()),
|
||||
start: json['start']?.toString() ?? '',
|
||||
end: json['end']?.toString() ?? '',
|
||||
description: json['description']?.toString() ?? '',
|
||||
description: decodeBase64(json['description']?.toString()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user