feat: introduce EPG API with caching and TV & Recordings UI with EPG Guide, Recordings, and Season Passes tabs.

This commit is contained in:
Michael committed 2026-03-09 10:47:30 +01:00
1 parent fa88746db6
commit 3232a3a226
3 files changed
+300 -263

No files matched your search

+27 -11
View File
@@ -28,7 +28,8 @@ class EpgApi {
try { try {
final playlist = await _getPlaylist(request); final playlist = await _getPlaylist(request);
if (playlist == null) { if (playlist == null) {
return Response.forbidden(json.encode({'error': 'Playlist non trouvée'}), return Response.forbidden(
json.encode({'error': 'Playlist non trouvée'}),
headers: {'Content-Type': 'application/json'}); headers: {'Content-Type': 'application/json'});
} }
@@ -38,11 +39,13 @@ class EpgApi {
'$dns/player_api.php?username=${playlist.username}&password=${playlist.password}' '$dns/player_api.php?username=${playlist.username}&password=${playlist.password}'
'&action=get_epg&stream_id=$channelId&limit=48'; '&action=get_epg&stream_id=$channelId&limit=48';
final response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 15)); final response =
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 15));
if (response.statusCode != 200) { if (response.statusCode != 200) {
return Response(response.statusCode, return Response(response.statusCode,
body: json.encode({'error': 'Erreur API Xtream: ${response.statusCode}'}), body: json
.encode({'error': 'Erreur API Xtream: ${response.statusCode}'}),
headers: {'Content-Type': 'application/json'}); headers: {'Content-Type': 'application/json'});
} }
@@ -57,7 +60,8 @@ class EpgApi {
expiresAt: DateTime.now().add(const Duration(minutes: 30)), expiresAt: DateTime.now().add(const Duration(minutes: 30)),
); );
return Response.ok(jsonStr, headers: {'Content-Type': 'application/json', 'X-Cache': 'MISS'}); return Response.ok(jsonStr,
headers: {'Content-Type': 'application/json', 'X-Cache': 'MISS'});
} catch (e) { } catch (e) {
return Response.internalServerError( return Response.internalServerError(
body: json.encode({'error': 'Erreur lors de la récupération EPG: $e'}), body: json.encode({'error': 'Erreur lors de la récupération EPG: $e'}),
@@ -80,24 +84,36 @@ class EpgApi {
final startRaw = item['start'] as String? ?? ''; final startRaw = item['start'] as String? ?? '';
final endRaw = item['stop'] as String? ?? item['end'] as String? ?? ''; final endRaw = item['stop'] as String? ?? item['end'] as String? ?? '';
// Normaliser les dates pour le frontend (Xtream format support)
final start = startRaw.contains(' ') && !startRaw.contains('T')
? startRaw.replaceFirst(' ', 'T')
: startRaw;
final end = endRaw.contains(' ') && !endRaw.contains('T')
? endRaw.replaceFirst(' ', 'T')
: endRaw;
// Décoder le titre (base64 si nécessaire) // Décoder le titre (base64 si nécessaire)
String title = item['title'] as String? ?? ''; String title = item['title'] as String? ?? '';
try { try {
title = utf8.decode(base64Decode(title)); if (title.isNotEmpty) {
} catch (_) { final decoded = utf8.decode(base64Decode(title));
// n'est pas du base64, garder tel quel if (decoded.isNotEmpty) title = decoded;
} }
} catch (_) {}
String description = item['description'] as String? ?? ''; String description = item['description'] as String? ?? '';
try { try {
description = utf8.decode(base64Decode(description)); if (description.isNotEmpty) {
final decoded = utf8.decode(base64Decode(description));
if (decoded.isNotEmpty) description = decoded;
}
} catch (_) {} } catch (_) {}
return { return {
'title': title, 'title': title,
'description': description, 'description': description,
'start': startRaw, 'start': start,
'end': endRaw, 'end': end,
'channel_id': channelId, 'channel_id': channelId,
}; };
}).toList(); }).toList();
+266 -247
View File
@@ -64,15 +64,17 @@ class _RecordingsTabState extends State<RecordingsTab>
unselectedLabelColor: Colors.white54, unselectedLabelColor: Colors.white54,
indicatorColor: Colors.redAccent, indicatorColor: Colors.redAccent,
indicatorWeight: 3, indicatorWeight: 3,
labelStyle: labelStyle: GoogleFonts.outfit(
GoogleFonts.outfit(fontWeight: FontWeight.w600, fontSize: 14), fontWeight: FontWeight.w600, fontSize: 14),
unselectedLabelStyle: GoogleFonts.outfit(fontSize: 14), unselectedLabelStyle: GoogleFonts.outfit(fontSize: 14),
tabs: const [ tabs: const [
Tab(icon: Icon(Icons.grid_view, size: 18), text: 'Guide TV'), Tab(icon: Icon(Icons.grid_view, size: 18), text: 'Guide TV'),
Tab( Tab(
icon: Icon(Icons.fiber_manual_record, size: 18), icon: Icon(Icons.fiber_manual_record, size: 18),
text: 'Enregistrements'), text: 'Enregistrements'),
Tab(icon: Icon(Icons.repeat, size: 18), text: 'Season Passes'), Tab(
icon: Icon(Icons.repeat, size: 18),
text: 'Season Passes'),
], ],
), ),
], ],
@@ -114,6 +116,7 @@ class _EpgGuideViewState extends ConsumerState<_EpgGuideView>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
String? _selectedCategory;
Channel? _selectedChannel; Channel? _selectedChannel;
// Map-based pour correspondre au format retourné par /api/epg/<id> // Map-based pour correspondre au format retourné par /api/epg/<id>
List<Map<String, dynamic>> _programmes = []; List<Map<String, dynamic>> _programmes = [];
@@ -137,7 +140,6 @@ class _EpgGuideViewState extends ConsumerState<_EpgGuideView>
} }
/// Charge le guide EPG complet via le backend /api/epg/<channelId> /// Charge le guide EPG complet via le backend /api/epg/<channelId>
/// Le backend appelle get_epg (48h de programmes) et décode le base64
Future<void> _loadEpg(Channel ch) async { Future<void> _loadEpg(Channel ch) async {
setState(() { setState(() {
_selectedChannel = ch; _selectedChannel = ch;
@@ -147,23 +149,20 @@ class _EpgGuideViewState extends ConsumerState<_EpgGuideView>
}); });
try { try {
final response = final response = await http.get(Uri.parse('/api/epg/${ch.streamId}'));
await http.get(Uri.parse('/api/epg/${ch.streamId}'));
if (mounted) { if (mounted) {
if (response.statusCode == 200) { if (response.statusCode == 200) {
final data = json.decode(response.body) as Map<String, dynamic>; final data = json.decode(response.body) as Map<String, dynamic>;
final list = final list = (data['programmes'] as List<dynamic>? ?? [])
(data['programmes'] as List<dynamic>? ?? []) .whereType<Map<String, dynamic>>()
.whereType<Map<String, dynamic>>() .toList();
.toList();
setState(() { setState(() {
_programmes = list; _programmes = list;
_loadingEpg = false; _loadingEpg = false;
}); });
} else { } else {
setState(() { setState(() {
_epgError = _epgError = 'Erreur ${response.statusCode}: ${response.body}';
'Erreur ${response.statusCode}: ${response.body}';
_loadingEpg = false; _loadingEpg = false;
}); });
} }
@@ -180,229 +179,266 @@ class _EpgGuideViewState extends ConsumerState<_EpgGuideView>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); // requis pour AutomaticKeepAliveClientMixin super.build(context);
final settings = ref.watch(iptvSettingsProvider); final settings = ref.watch(iptvSettingsProvider);
final channelsAsync = final channelsAsync =
ref.watch(liveChannelsByPlaylistProvider(widget.playlist)); ref.watch(liveChannelsByPlaylistProvider(widget.playlist));
return Padding( return Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Row( child: channelsAsync.when(
crossAxisAlignment: CrossAxisAlignment.start, loading: () => const Center(child: CircularProgressIndicator()),
children: [ error: (e, _) => Center(child: Text('Erreur: $e')),
// ── Colonne gauche : liste des chaînes ── data: (groupedChannels) {
SizedBox( final categories = groupedChannels.keys
width: 230, .where((cat) =>
child: Column(children: [ settings.liveTvKeywords.isEmpty ||
// Barre de recherche settings.matchesLiveTvFilter(cat))
TextField( .toList();
controller: _searchCtrl,
style: const TextStyle(color: Colors.white, fontSize: 13),
decoration: InputDecoration(
hintText: 'Rechercher...',
hintStyle:
const TextStyle(color: Colors.white38, fontSize: 13),
prefixIcon: const Icon(Icons.search,
color: Colors.white38, size: 18),
filled: true,
fillColor: Colors.white.withOpacity(0.07),
contentPadding: const EdgeInsets.symmetric(vertical: 8),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide.none,
),
),
),
const SizedBox(height: 8),
Expanded(
child: channelsAsync.when(
loading: () => const Center(
child: CircularProgressIndicator(strokeWidth: 2)),
error: (e, _) => Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Erreur chargement chaînes:\n$e',
style: const TextStyle(
color: Colors.redAccent, fontSize: 11),
textAlign: TextAlign.center),
)),
data: (groupedChannels) {
// Appliquer le filtre settings (identique à l'onglet Live TV)
final filtered = <Channel>[];
for (final entry in groupedChannels.entries) {
if (settings.liveTvKeywords.isEmpty ||
settings.matchesLiveTvFilter(entry.key)) {
filtered.addAll(entry.value);
}
}
filtered.sort((a, b) => a.name.compareTo(b.name));
final visible = _searchQuery.isEmpty // Initial category selection
? filtered if (_selectedCategory == null && categories.isNotEmpty) {
: filtered _selectedCategory = categories.first;
.where((c) => }
c.name.toLowerCase().contains(_searchQuery))
.toList();
if (visible.isEmpty) { final channelsInCategory = groupedChannels[_selectedCategory] ?? [];
return Center( final visibleChannels = _searchQuery.isEmpty
child: Text( ? channelsInCategory
settings.liveTvKeywords.isEmpty : groupedChannels.values
? 'Aucune chaîne disponible' .expand((l) => l)
: 'Aucune chaîne correspondant\naux filtres Settings', .where((c) => c.name.toLowerCase().contains(_searchQuery))
textAlign: TextAlign.center, .toList();
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// ── Colonne 1 : CATÉGORIES ──
SizedBox(
width: 180,
child: Column(
children: [
Text('GROUPES',
style: GoogleFonts.outfit( style: GoogleFonts.outfit(
color: Colors.white38, fontSize: 12), color: Colors.white38,
)); fontSize: 10,
} fontWeight: FontWeight.bold,
letterSpacing: 1.2)),
return ListView.builder( const SizedBox(height: 8),
itemCount: visible.length, Expanded(
itemBuilder: (ctx, i) { child: ListView.builder(
final ch = visible[i]; itemCount: categories.length,
final isSelected = itemBuilder: (ctx, i) {
_selectedChannel?.streamId == ch.streamId; final cat = categories[i];
return InkWell( final isSelected = _selectedCategory == cat;
onTap: () => _loadEpg(ch), return InkWell(
borderRadius: BorderRadius.circular(8), onTap: () => setState(() {
child: Container( _selectedCategory = cat;
margin: const EdgeInsets.only(bottom: 3), _searchCtrl.clear();
padding: const EdgeInsets.symmetric( _searchQuery = '';
horizontal: 10, vertical: 7), }),
decoration: BoxDecoration( child: Container(
color: isSelected padding: const EdgeInsets.symmetric(
? Colors.redAccent.withOpacity(0.2) horizontal: 12, vertical: 10),
: Colors.white.withOpacity(0.05), margin: const EdgeInsets.only(bottom: 4),
borderRadius: BorderRadius.circular(8), decoration: BoxDecoration(
border: Border.all(
color: isSelected color: isSelected
? Colors.redAccent.withOpacity(0.5) ? Colors.white.withOpacity(0.1)
: Colors.transparent, : Colors.transparent,
borderRadius: BorderRadius.circular(8),
), ),
), child: Text(
child: Row(children: [ cat,
// Logo chaîne style: GoogleFonts.outfit(
ch.streamIcon.isNotEmpty
? ClipRRect(
borderRadius: BorderRadius.circular(3),
child: Image.network(
ch.streamIcon,
width: 26,
height: 18,
fit: BoxFit.contain,
errorBuilder: (_, __, ___) =>
const Icon(Icons.tv,
color: Colors.white38,
size: 18),
),
)
: const Icon(Icons.tv,
color: Colors.white38, size: 18),
const SizedBox(width: 8),
Expanded(
child: Text(
ch.name,
style: GoogleFonts.outfit(
color: isSelected color: isSelected
? Colors.white ? Colors.white
: Colors.white70, : Colors.white60,
fontSize: 12, fontSize: 12,
fontWeight: isSelected fontWeight: isSelected
? FontWeight.bold ? FontWeight.bold
: FontWeight.normal, : FontWeight.normal),
), maxLines: 1,
maxLines: 2, overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
),
), ),
]), ),
), );
); },
}, ),
); ),
}, ],
), ),
), ),
]),
),
const SizedBox(width: 16), const VerticalDivider(width: 32, color: Colors.white10),
// ── Colonne droite : programmes EPG ── // ── Colonne 2 : CHAÎNES ──
Expanded( SizedBox(
child: _selectedChannel == null width: 250,
? Center( child: Column(children: [
child: Column( // Barre de recherche
mainAxisSize: MainAxisSize.min, TextField(
children: [ controller: _searchCtrl,
const Icon(Icons.tv_off, style: const TextStyle(color: Colors.white, fontSize: 13),
size: 64, color: Color(0x1FFFFFFF)), decoration: InputDecoration(
const SizedBox(height: 16), hintText: 'Rechercher...',
Text( hintStyle:
'Sélectionnez une chaîne\npour voir son guide des programmes', const TextStyle(color: Colors.white38, fontSize: 13),
textAlign: TextAlign.center, prefixIcon: const Icon(Icons.search,
style: GoogleFonts.outfit( color: Colors.white38, size: 18),
color: Colors.white38, fontSize: 15), filled: true,
), fillColor: Colors.white.withOpacity(0.07),
], contentPadding: const EdgeInsets.symmetric(vertical: 8),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide.none,
),
), ),
) ),
: Column( const SizedBox(height: 12),
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: visibleChannels.isEmpty
Row(children: [ ? Center(
Text( child: Text('Aucune chaîne',
_selectedChannel!.name, style: TextStyle(
style: GoogleFonts.outfit( color: Colors.white24, fontSize: 12)))
color: Colors.white, : ListView.builder(
fontWeight: FontWeight.bold, itemCount: visibleChannels.length,
fontSize: 16, itemBuilder: (ctx, i) {
), final ch = visibleChannels[i];
), final isSelected =
const Spacer(), _selectedChannel?.streamId == ch.streamId;
IconButton( return InkWell(
icon: const Icon(Icons.refresh, onTap: () => _loadEpg(ch),
color: Colors.white54, size: 18), borderRadius: BorderRadius.circular(8),
tooltip: 'Recharger l\'EPG', child: Container(
onPressed: () => _loadEpg(_selectedChannel!), margin: const EdgeInsets.only(bottom: 3),
), padding: const EdgeInsets.symmetric(
]), horizontal: 10, vertical: 8),
const Divider(color: Colors.white12), decoration: BoxDecoration(
Expanded( color: isSelected
child: _loadingEpg ? Colors.redAccent.withOpacity(0.2)
? const Center(child: CircularProgressIndicator()) : Colors.white.withOpacity(0.05),
: _epgError.isNotEmpty borderRadius: BorderRadius.circular(8),
? Center( border: Border.all(
child: Text( color: isSelected
'Erreur EPG: $_epgError', ? Colors.redAccent.withOpacity(0.5)
style: const TextStyle( : Colors.transparent,
color: Colors.redAccent,
fontSize: 12),
textAlign: TextAlign.center,
), ),
) ),
: _programmes.isEmpty child: Row(children: [
ch.streamIcon.isNotEmpty
? Image.network(ch.streamIcon,
width: 24,
height: 16,
fit: BoxFit.contain,
errorBuilder: (_, __, ___) =>
const Icon(Icons.tv,
color: Colors.white24,
size: 16))
: const Icon(Icons.tv,
color: Colors.white24, size: 16),
const SizedBox(width: 10),
Expanded(
child: Text(
ch.name,
style: GoogleFonts.outfit(
color: isSelected
? Colors.white
: Colors.white70,
fontSize: 12,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
]),
),
);
},
),
),
]),
),
const VerticalDivider(width: 32, color: Colors.white10),
// ── Colonne droite : programmes EPG ──
Expanded(
child: _selectedChannel == null
? Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.tv_off,
size: 64, color: Color(0x1FFFFFFF)),
const SizedBox(height: 16),
Text(
'Sélectionnez une chaîne\npour voir son guide des programmes',
textAlign: TextAlign.center,
style: GoogleFonts.outfit(
color: Colors.white38, fontSize: 15),
),
],
),
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
Text(
_selectedChannel!.name,
style: GoogleFonts.outfit(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const Spacer(),
IconButton(
icon: const Icon(Icons.refresh,
color: Colors.white54, size: 18),
tooltip: 'Recharger l\'EPG',
onPressed: () => _loadEpg(_selectedChannel!),
),
]),
const Divider(color: Colors.white12),
Expanded(
child: _loadingEpg
? const Center(
child: CircularProgressIndicator())
: _epgError.isNotEmpty
? Center( ? Center(
child: Text( child: Text(
'Aucun programme EPG disponible\npour cette chaîne', 'Erreur EPG: $_epgError',
style: const TextStyle(
color: Colors.redAccent,
fontSize: 12),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: GoogleFonts.outfit(
color: Colors.white38),
), ),
) )
: ListView.builder( : _programmes.isEmpty
itemCount: _programmes.length, ? Center(
itemBuilder: (ctx, i) => child: Text(
_ProgrammeCard( 'Aucun programme EPG disponible\npour cette chaîne',
programme: _programmes[i], textAlign: TextAlign.center,
channel: _selectedChannel!, style: GoogleFonts.outfit(
), color: Colors.white38),
), ),
)
: ListView.builder(
itemCount: _programmes.length,
itemBuilder: (ctx, i) =>
_ProgrammeCard(
programme: _programmes[i],
channel: _selectedChannel!,
),
),
),
],
), ),
], ),
), ],
), );
], },
), ),
); );
} }
@@ -429,8 +465,8 @@ class _ProgrammeCard extends StatelessWidget {
String _fmt(String raw) { String _fmt(String raw) {
if (raw.isEmpty) return ''; if (raw.isEmpty) return '';
try { try {
// Format Xtream : "2026-03-09 09:00:00" ou ISO "2026-03-09T09:00:00Z" final dt = EpgEntry.parseDateTime(raw)?.toLocal();
final dt = DateTime.parse(raw.replaceFirst(' ', 'T')).toLocal(); if (dt == null) return raw.length >= 16 ? raw.substring(11, 16) : raw;
return '${dt.hour.toString().padLeft(2, '0')}:${dt.minute.toString().padLeft(2, '0')}'; return '${dt.hour.toString().padLeft(2, '0')}:${dt.minute.toString().padLeft(2, '0')}';
} catch (_) { } catch (_) {
return raw.length >= 16 ? raw.substring(11, 16) : raw; return raw.length >= 16 ? raw.substring(11, 16) : raw;
@@ -438,12 +474,7 @@ class _ProgrammeCard extends StatelessWidget {
} }
DateTime? _parseTime(String raw) { DateTime? _parseTime(String raw) {
if (raw.isEmpty) return null; return EpgEntry.parseDateTime(raw);
try {
return DateTime.parse(raw.replaceFirst(' ', 'T')).toUtc();
} catch (_) {
return null;
}
} }
bool get _isNow { bool get _isNow {
@@ -511,8 +542,7 @@ class _ProgrammeCard extends StatelessWidget {
onPressed: () => Navigator.pop(ctx), onPressed: () => Navigator.pop(ctx),
child: const Text('Annuler')), child: const Text('Annuler')),
ElevatedButton( ElevatedButton(
style: style: ElevatedButton.styleFrom(backgroundColor: Colors.redAccent),
ElevatedButton.styleFrom(backgroundColor: Colors.redAccent),
onPressed: () async { onPressed: () async {
Navigator.pop(ctx); Navigator.pop(ctx);
await _saveRecording( await _saveRecording(
@@ -578,8 +608,7 @@ class _ProgrammeCard extends StatelessWidget {
), ),
), ),
child: ListTile( child: ListTile(
contentPadding: contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
leading: SizedBox( leading: SizedBox(
width: 52, width: 52,
child: Column( child: Column(
@@ -646,7 +675,6 @@ class _ProgrammeCard extends StatelessWidget {
} }
} }
// ═══════════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════════
// ONGLET 2 — ENREGISTREMENTS // ONGLET 2 — ENREGISTREMENTS
// ═══════════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════════
@@ -710,8 +738,7 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
Future<void> _showLogs(String id, String title) async { Future<void> _showLogs(String id, String title) async {
try { try {
final response = final response = await http.get(Uri.parse('/api/recordings/logs/$id'));
await http.get(Uri.parse('/api/recordings/logs/$id'));
if (!mounted) return; if (!mounted) return;
final content = response.statusCode == 200 final content = response.statusCode == 200
? (json.decode(response.body)['logs'] as String? ?? 'Aucun log') ? (json.decode(response.body)['logs'] as String? ?? 'Aucun log')
@@ -793,8 +820,7 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
: _error != null : _error != null
? Center( ? Center(
child: Text(_error!, child: Text(_error!,
style: style: const TextStyle(color: Colors.redAccent)))
const TextStyle(color: Colors.redAccent)))
: _recordings.isEmpty : _recordings.isEmpty
? Center( ? Center(
child: Column( child: Column(
@@ -822,13 +848,11 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
color: Colors.white.withOpacity(0.05), color: Colors.white.withOpacity(0.05),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all( border: Border.all(
color: color: Colors.white.withOpacity(0.1)),
Colors.white.withOpacity(0.1)),
), ),
child: ListTile( child: ListTile(
contentPadding: contentPadding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric( horizontal: 16, vertical: 8),
horizontal: 16, vertical: 8),
leading: Icon( leading: Icon(
status == 'recording' status == 'recording'
? Icons.fiber_manual_record ? Icons.fiber_manual_record
@@ -864,13 +888,11 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 4), horizontal: 10, vertical: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: color.withOpacity(0.15),
color.withOpacity(0.15),
borderRadius: borderRadius:
BorderRadius.circular(20), BorderRadius.circular(20),
border: Border.all( border: Border.all(
color: color: color.withOpacity(0.4)),
color.withOpacity(0.4)),
), ),
child: Text(_statusLabel(status), child: Text(_statusLabel(status),
style: TextStyle( style: TextStyle(
@@ -881,8 +903,7 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
const SizedBox(width: 4), const SizedBox(width: 4),
if (status == 'recording') if (status == 'recording')
IconButton( IconButton(
icon: const Icon( icon: const Icon(Icons.stop_circle,
Icons.stop_circle,
color: Colors.redAccent), color: Colors.redAccent),
tooltip: 'Arrêter', tooltip: 'Arrêter',
onPressed: () => _stopRecording( onPressed: () => _stopRecording(
@@ -898,10 +919,8 @@ class _RecordingsListViewState extends State<_RecordingsListView> {
rec['id'], rec['title'] ?? ''), rec['id'], rec['title'] ?? ''),
), ),
IconButton( IconButton(
icon: const Icon( icon: const Icon(Icons.delete_outline,
Icons.delete_outline, color: Colors.white38, size: 20),
color: Colors.white38,
size: 20),
tooltip: 'Supprimer', tooltip: 'Supprimer',
onPressed: () => onPressed: () =>
_deleteRecording(rec['id']), _deleteRecording(rec['id']),
@@ -984,15 +1003,16 @@ class _SeasonPassesViewState extends State<_SeasonPassesView> {
child: Column(mainAxisSize: MainAxisSize.min, children: [ child: Column(mainAxisSize: MainAxisSize.min, children: [
Text( Text(
'Enregistre automatiquement toutes les nouvelles diffusions d\'une émission.', 'Enregistre automatiquement toutes les nouvelles diffusions d\'une émission.',
style: style: GoogleFonts.outfit(color: Colors.white54, fontSize: 13),
GoogleFonts.outfit(color: Colors.white54, fontSize: 13),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
_buildField(titleCtrl, 'Titre de l\'émission (ex: Champions League)'), _buildField(
titleCtrl, 'Titre de l\'émission (ex: Champions League)'),
const SizedBox(height: 8), const SizedBox(height: 8),
_buildField(channelCtrl, 'Channel ID (ex: 554021)'), _buildField(channelCtrl, 'Channel ID (ex: 554021)'),
const SizedBox(height: 8), const SizedBox(height: 8),
_buildField(urlCtrl, 'stream_url (optionnel, ex: /api/live/554021.ts)'), _buildField(
urlCtrl, 'stream_url (optionnel, ex: /api/live/554021.ts)'),
]), ]),
), ),
actions: [ actions: [
@@ -1000,8 +1020,8 @@ class _SeasonPassesViewState extends State<_SeasonPassesView> {
onPressed: () => Navigator.pop(ctx), onPressed: () => Navigator.pop(ctx),
child: const Text('Annuler')), child: const Text('Annuler')),
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style:
backgroundColor: Colors.purpleAccent), ElevatedButton.styleFrom(backgroundColor: Colors.purpleAccent),
onPressed: () async { onPressed: () async {
final t = titleCtrl.text.trim(); final t = titleCtrl.text.trim();
final c = channelCtrl.text.trim(); final c = channelCtrl.text.trim();
@@ -1056,11 +1076,10 @@ class _SeasonPassesViewState extends State<_SeasonPassesView> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Enregistrements automatiques', Text('Enregistrements automatiques',
style: style: GoogleFonts.outfit(color: Colors.white54, fontSize: 13)),
GoogleFonts.outfit(color: Colors.white54, fontSize: 13)),
ElevatedButton.icon( ElevatedButton.icon(
style: style: ElevatedButton.styleFrom(
ElevatedButton.styleFrom(backgroundColor: Colors.purpleAccent), backgroundColor: Colors.purpleAccent),
icon: const Icon(Icons.add, size: 18), icon: const Icon(Icons.add, size: 18),
label: const Text('Nouveau'), label: const Text('Nouveau'),
onPressed: _showCreate, onPressed: _showCreate,
+7 -5
View File
@@ -6,16 +6,17 @@ Activation de l'agent Bmad Master pour coordonner les modules BMAD et gérer le
## Current Focus ## Current Focus
Analyse du workflow Bmad Master et configuration initiale. Refonte du Guide TV pour inclure les catégories et corriger l'EPG.
## Master Plan ## Master Plan
- [x] Analyser le workflow Bmad Master (`bmad-core-agents-bmad-master.md`) - [x] Analyser le workflow Bmad Master (`bmad-core-agents-bmad-master.md`)
- [x] Configurer l'environnement pour l'agent Master - [x] Configurer l'environnement pour l'agent Master
- [x] Initialiser la session avec l'agent Master - [x] Initialiser la session avec l'agent Master
- [x] Diagnostiquer l'absence d'EPG - [x] Correction initiale du parsing EPG
- [x] Diagnostiquer le problème de tri des chaînes - [x] Suppression du tri alphabétique forcé
- [x] Vérifier l'état de l'agent et des sous-modules - [/] Refonte du Guide TV (Catégories + EPG détaillé)
- [ ] Correction de l'endpoint EPG Backend
## Progress Log ## Progress Log
@@ -23,5 +24,6 @@ Analyse du workflow Bmad Master et configuration initiale.
- [x] Lecture du workflow et de la configuration - [x] Lecture du workflow et de la configuration
- [x] Validation du plan d'activation par Michael - [x] Validation du plan d'activation par Michael
- [x] Activation de l'identité Bmad Master - [x] Activation de l'identité Bmad Master
- [x] Correction du parsing de date EPG (Xtream format support) - [x] Correction initiale du parsing EPG
- [x] Suppression du tri alphabétique forcé - [x] Suppression du tri alphabétique forcé
- [x] Analyse des manques du Guide TV (tri par groupe)