mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-20 13:38:05 +02:00
Multi-IPTV : déclarer l'IPTV active de façon synchrone dans AuthedHttp
AuthedHttp lisait l'IPTV dans localStorage, écrit par un écouteur Riverpod enregistré tardivement : après un changement d'IPTV l'en-tête X-Playlist-Id pouvait rester périmé. AuthedHttp.usePlaylist pose l'IPTV en mémoire dès la sélection et à chaque construction du tableau de bord. Auto NBA reçoit la playlist, recharge sa règle quand elle change et nomme l'IPTV sur laquelle les matchs sont enregistrés. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a6322b57b8
commit
6368fd6ee2
6 files changed
+58
-7
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../../core/api/authed_http.dart';
|
||||
import '../../../../core/models/playlist_config.dart';
|
||||
import '../../../widgets/mobile_scaffold.dart';
|
||||
import '../../../theme/mobile_theme.dart';
|
||||
@@ -26,6 +27,8 @@ class _MobileDashboardScreenState extends ConsumerState<MobileDashboardScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Toutes les requêtes /api/* de ce tableau de bord visent cette IPTV.
|
||||
AuthedHttp.usePlaylist(widget.playlist.id, json: widget.playlist.toJson());
|
||||
return Theme(
|
||||
data: MobileTheme.darkTheme,
|
||||
child: MobileScaffold(
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
import '../../../../features/iptv/providers/xtream_provider.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import '../../../../core/services/playlist_api_service.dart';
|
||||
import '../../../../core/api/authed_http.dart';
|
||||
import '../../../../core/models/playlist_config.dart';
|
||||
import '../../../../features/auth/providers/auth_provider.dart';
|
||||
import '../../../../core/theme/app_colors.dart';
|
||||
@@ -108,6 +109,7 @@ class MobilePlaylistSelectionScreen extends ConsumerWidget {
|
||||
return _MobilePlaylistCard(
|
||||
playlist: playlist,
|
||||
onTap: () {
|
||||
AuthedHttp.usePlaylist(playlist.id, json: playlist.toJson());
|
||||
// Choix + persistance dans le même geste : l'en-tête
|
||||
// X-Playlist-Id doit partir dès la première requête.
|
||||
selectPlaylist(ref, playlist);
|
||||
|
||||
Reference in new issue
Block a user