Commit Graph
49 Commits
Author SHA1 Message Date
MichaelandClaude Opus 5.5 fdf98f9659 Films : demander le fichier sous sa vraie extension
Le serveur réclamait toujours <id>.mkv au panneau. Un film stocké en .mp4
était refusé (HTTP 551 constaté en prod). Le client transmet désormais
container_extension (?ext=), validé côté serveur ; mkv reste le défaut
pour un client qui ne l'envoie pas. Même approche que xtremobile, qui lit
ces films sans souci.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:09:11 +02:00
Claude 85a8d16542 Lecture vidéo : son garanti sur toutes les chaînes, zapping et démarrages accélérés
Son manquant sur certaines chaînes :
- Nouvelle route GET /api/live/<id>/turbo.ts pour le player web : vidéo
  copiée (-c:v copy), audio TOUJOURS réencodé en AAC. mpegts.js ne démuxe
  que l'AAC/MP3 : les chaînes en AC-3/E-AC-3/MP2 passaient par le proxy
  brut → image sans son, et le fallback HLS côté client ne couvrait pas
  les codecs démuxés mais non décodables par le navigateur (MP2)
- getLiveStreamUrlTs pointe sur la route turbo ; le proxy brut
  /api/live/<id>.ts reste inchangé pour le scheduler d'enregistrement
- FFmpeg turbo tué dès que le client zappe (onCancel) ; stderr redacté
- Le fallback client (_hlsEquivalent) reconnaît le nouveau format d'URL
  et reste en filet de sécurité

Temps de chargement :
- Players vendorisés mis à jour : hls.js 1.6.7 → 1.7.1,
  mpegts.js 1.7.3 → 1.8.2
- Live HLS et turbo : -fflags nobuffer + probesize/analyzeduration 1 Mo
  (sans borne, FFmpeg pouvait sonder plusieurs secondes avant le premier
  segment)
- VOD : probesize 10 Mo → 5 Mo, analyzeduration 5 s → 2 s
- Live 'high' : preset medium → veryfast (zerolatency déjà actif) ;
  lecture d'enregistrement : medium/crf18 → veryfast/crf20 (medium ne
  tenait pas le temps réel en 1080p sur CPU modeste)
- waitForPlaylist : polling 500 ms → 100 ms
- Suppression du cache-buster &v=timestamp qui re-téléchargeait
  player.html à chaque zap ; les .html sont servis en no-cache côté
  serveur pour garder la fraîcheur après déploiement
- mpegts.js : liveBufferLatencyChasing activé en profil « fast » — les
  micro-coupures ne font plus dériver la lecture derrière le direct

Validé : dart analyze (0 issue) + dart test (48/48) sur bin/, syntaxe JS
vérifiée.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oEu9QayWsw7hCKhenxgVa
2026-08-27 21:17:27 +00:00
MichaelandClaude Opus 5 5ab7203c8d fix(epg): cache client du guide et plafond de débit relevé
Les journaux du serveur montrent la grille Live TV se faire couper en 429 :
"Rate limit exceeded", une trentaine de requêtes refusées d'affilée après
quelques écrans de défilement.

Deux causes cumulées. D'une part le passage du guide de Dio vers AuthedHttp a
fait perdre le cache de réponses qui existait auparavant : chaque
reconstruction de tuile repartait en requête. Un cache mémoire de dix minutes
le rétablit — le backend garde déjà ces réponses trente minutes, il n'y a
aucune raison d'aller les rechercher.

D'autre part le plafond de deux cents requêtes par minute et par adresse était
trop bas pour l'usage réel : une grille demande un logo et un guide par tuile,
et tous les clients partagent l'adresse du reverse proxy. Il passe à six
cents.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 11:17:55 +02:00
MichaelandClaude Opus 5 5b9eb74a84 feat(epg): source XMLTV de repli quand le panneau ne rend rien d'actuel
Le guide du fournisseur est figé sur beaucoup de revendeurs : sur le compte de
test, get_simple_data_table répond correctement mais le dernier programme
français date de deux jours, et le xmltv.php du panneau ne couvre aucune chaîne
française. Aucun correctif côté appel Xtream ne pouvait donc remplir la grille.

Nouveau service XmltvEpgService : téléchargement de dumps XMLTV publics,
décompression gzip détectée sur le nombre magique, parsing en flux via
XmlEventReader — un dump national fait 46 Mo décompressés, en charger l'arbre
DOM coûterait plusieurs centaines de mégaoctets dans le conteneur. Mesuré à
environ 1 s pour 973 chaînes. Index rafraîchi toutes les 6 h, programmes
terminés depuis plus de 6 h écartés à l'indexation.

L'appel sortant reste un dernier recours. L'ordre est inchangé —
get_simple_data_table, puis get_short_epg — et le dump n'est consulté que si
le panneau ne rend aucun programme couvrant l'instant présent : compter les
entrées ne suffisait pas, un guide périmé en renvoie des centaines. La source
se configure par EPG_XMLTV_URLS ; vider la variable supprime tout appel
sortant. La réponse porte un en-tête X-Epg-Source pour savoir qui a répondu.

Les identifiants sont rapprochés après normalisation : le dump écrit
France.2.fr là où le panneau annonce France2.fr. Repli sur le nom affiché de
la chaîne, et table stream_id vers identifiant EPG mise en cache 6 h.

Le client passe désormais par /api/epg au lieu d'appeler player_api.php en
direct. Il dupliquait le choix de l'action, la conversion des fuseaux et le
décodage base64 ; le backend le fait une fois, met en cache pour tous les
utilisateurs, et sait basculer sur le repli — bascule impossible depuis le
navigateur.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 10:48:10 +02:00
MichaelandClaude Opus 5 537312908a fix(epg,ui): utiliser get_simple_data_table pour l'EPG et recaler la sidebar sur le thème
EPG — les trois chemins (backend /api/epg, XtreamService.getShortEpg et
getShortEPG) n'utilisaient que get_epg et get_short_epg. Beaucoup de
panneaux Xtream ne connaissent pas get_epg : ils répondent 200 avec le
bloc d'authentification, sans epg_listings, ce qui produisait un guide
vide indiscernable d'une chaîne sans programme. get_short_epg y renvoie
epg_listings vide en permanence.

- backend : get_simple_data_table en premier, get_short_epg en repli
- client : bascule automatique et mémorisée vers le tableau complet dès
  qu'un panneau est muet sur l'action légère, pour ne pas doubler les
  requêtes sur chaque tuile de grille
- dates dérivées des *_timestamp epoch et émises en ISO-8601 UTC : les
  champs texte sont dans le fuseau du panneau, sans indicateur de zone,
  et étaient relus comme de l'heure locale — le guide était décalé et
  les enregistrements planifiés depuis le guide l'étaient aussi
- cache backend : la clé incluait seulement le channelId, deux playlists
  partageant un stream_id se servaient mutuellement leur guide

UI — les deux halos d'ambiance du dashboard étaient restés de l'ancien
thème : primary (#FFB68C) à 40 % posé sur le coin haut-gauche, donc pile
derrière la sidebar, et info (#A3B8C4, bleu-gris) à 35 % dans une palette
entièrement chaude. Ramenés à des braises ember à 8 % / 6 %.

- fond via AppColors.backgroundGradient
- onglet actif rempli en primaryContainer (surface) et non primary
  (teinte claire réservée au texte/icônes)
- sidebar en niveau flottant : en niveau 1 son fond #181310 se confondait
  avec le haut du dégradé #1A1310

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 09:53:17 +02:00
MichaelandClaude Opus 5 51e6d9d693 fix(epg): stop swallowing EPG failures, cap gateway concurrency
getShortEpg ended in `catch (e) { return []; }`, so a 401, a timeout, a
rate-limited panel and a genuinely empty guide all rendered the same
"No Info" label. That made the current problem undiagnosable from the
UI. Failures are now logged with the HTTP status, the Dio error type and
the response shape.

Two concrete causes are handled while we are here:

- Some Xtream panels answer player_api.php with a textual Content-Type.
  Dio then hands back a raw String, and `response.data['epg_listings']`
  threw, landing in the silent catch. The body is now parsed explicitly
  when it arrives as a String.
- The channel grid mounts one EPG provider per visible tile, firing
  ~32 concurrent requests at player_api.php. Many panels rate-limit well
  below that and fail the whole batch. A 3-slot semaphore serialises
  them in small groups.

This does not by itself prove why the guide is empty in production; it
makes the reason visible in the browser console.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 22:14:47 +02:00
MichaelandClaude Fable 5 60d3f42901 feat: security hardening, streaming overhaul, design polish, tests
Security:
- Replace unsalted SHA-256 password hashing with bcrypt (lazy rehash on login)
- Add authenticated /api/xtream-api gateway: Xtream credentials are injected
  server-side and never sent to the frontend; /api/playlists no longer
  returns passwords
- Redact credentials from all logs (login body, proxy/FFmpeg/scheduler URLs)
- Add auth to recordings, EPG, season-passes and streaming routes
  (HttpOnly session cookie for hls.js; loopback bypass for local FFmpeg)
- Lock player postMessage to same-origin in both directions
- Vendor and pin hls.js 1.6.7 / mpegts.js 1.7.3 (drop CDN @latest)
- Fix rate limiter (client IP was never resolved), add login rate limit,
  restrict CORS, add CSP Report-Only, block private-IP SSRF targets,
  fix path traversal in recording log retrieval, chmod 777 -> 770
- Remove dead HiveService (seeded admin/admin into IndexedDB with SHA-256)
- Fix authMiddleware not populating 'user' context (getPlaylist ignored the
  logged-in user; admin purge always returned 403)

Streaming:
- New FfmpegSessionManager: process registry, idle reaper (4 min live /
  15 min VOD), orphan cleanup at startup, clean SIGTERM shutdown,
  fast-fail with stderr instead of 30 s timeout
- Quality selection (source/high/medium/low) for live and VOD; source mode
  streams with -c:v copy (zero transcoding); selector wired into the player
- Concurrent recordings (MAX_CONCURRENT_RECORDINGS, default 2); conflicts
  retry on the next tick instead of silently failing
- Lower live latency (HLS window 20 -> 10 segments, liveSync 10 -> 3)
- Fix recording log lookup (.mp4 vs .mkv mismatch)

Design:
- Replace hardcoded colors with AppColors tokens (12 files)
- web/theme.css syncs HTML players with the Flutter palette
- DPAD/keyboard navigation (arrow-key focus, player shortcuts)
- Tooltips on player icon buttons, Semantics on content cards
- Remove 7 dead widgets broken since the Stitch merge

Quality:
- bin/test/: 21 unit tests (bcrypt, redaction, traversal, SSRF, recording
  conflicts) plus a quality-selector widget test
- GitHub Actions CI (analyze + test + build web)
- Archive stale status docs into docs/archive/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:07:18 +02:00
Michael 6a4a642611 feat: implement IPTV player screen with iframe-based stream support and recordings tab widget 2026-04-01 20:19:40 +02:00
Michael fa6ae90d8d feat: add mobile-optimized IPTV player with HLS and MpegTS support 2026-03-29 10:19:36 +02:00
GitHub Copilot ee97e29f72 fix(cache): remove unused dio_cache_interceptor_hive_store import and simplify caching setup 2026-03-26 10:48:56 +01:00
Michael b8682eafe0 fix: resolve compilation error in XtreamService by restoring missing streams variable 2026-03-10 19:50:21 +01:00
Michael bb8978efaa perf: accelerate metadata loading with parallel fetching and local storage caching
- Implement parallel fetching for categories and streams in Live, VOD, and Series
- Add persistent local storage caching for instant UI population
- Optimize JSON parsing logic for large datasets
- Implement failover to local cache when network is unavailable
2026-03-10 18:59:39 +01:00
Michael df4bcfd07f fix: stabilize IPTV playback and implement request throttling
- Add playback lock to XtreamService to delay EPG during stream init
- Increase MPEG-TS stash buffer to 512KB for better stability
- Enable liveBufferLatencyChasing to prevent stream drift
- Tune HLS parameters for balanced speed and reliability
2026-03-10 18:54:44 +01:00
Michael 0ca6f96710 feat: implement Turbo-Start stream acceleration
- Add direct MPEG-TS support and optimized HLS tuning
- Implement low-latency sync and instant bitrate selection
- Achieve TiviMate-like zapping speed by reducing initial buffers
2026-03-10 18:41:46 +01:00
Michael 736ab0f51c chore: optimize IPTV performance and fix navigation Loop
- Revert aggressive caching in XtreamService (use forceCache + 1h stale)
- Adjust HLS.js buffers (60s-120s) for stream stability
- Fix desktop navigation loop in PlaylistSelectionScreen
- Fix receive timeouts (revert to 30s/60s)
2026-03-10 18:28:10 +01:00
Michael 8c65e48bbe feat: Implement Xtream IPTV API service, including data fetching, caching, and proxy integration. 2026-03-10 16:48:28 +01:00
Michael 36a74d9e97 fix: increase default timeouts and ensure they are applied to XtreamService 2026-03-10 15:44:04 +01:00
Michael 36a4de2140 fix(compilation): resolved undefined 'options' variable and optimized Docker build 2026-03-10 13:06:40 +01:00
Michael e707bda597 feat: implement Xtream Codes API service for authentication, live channels, VOD, and series, including caching and URL proxying. 2026-03-10 12:14:47 +01:00
Michael 129bcadd37 feat: Add Xtream API service for IPTV features and precache web artifacts in Dockerfile. 2026-03-10 12:00:43 +01:00
Michael 4f6b5fe14e feat: Implement Xtream Codes API service for IPTV content and streamline the Dockerfile web build process. 2026-03-10 11:19:15 +01:00
Michael 33d0e0a80d fix(streaming): optimize quality, audio sync, and content update refresh
- Increased FFmpeg video quality to 8Mbps and audio to 192kbps.
- Added audio resync filters and better presets.
- Optimized HLS buffer settings for mobile players to reduce interruptions.
- Reduced API cache duration to 15m and added refresh support for faster content updates.
2026-03-10 10:26:24 +01:00
Michael 39f4205d68 fix(mobile): fix XtreamService cache/URL logic and add tab error handling 2026-03-09 18:18:20 +01:00
Michael c57273be2c feat: Implement GPU-accelerated live HLS streaming with FFmpeg, including iOS optimizations and IPTV redirect resolution. 2026-03-09 14:10:13 +01:00
Michael 0b5aa3f9e4 feat: Implement initial streaming handler for live and VOD content using FFmpeg HLS transcoding with GPU acceleration support. 2026-03-09 13:46:56 +01:00
Michael bd7645922d feat: add Xtream API proxy with SSRF protection and streaming handler with FFmpeg integration. 2026-03-09 13:41:56 +01:00
Michael 7eb483fc07 feat: introduce IPTV settings management with a dedicated mobile tab, providers, and service. 2026-03-09 13:31:01 +01:00
Michael 829c5751ca feat: implement initial mobile IPTV feature with player screen, live TV, movies, and series tabs, along with the Xtream API service. 2026-03-09 13:16:29 +01:00
Michael b9d6d715d7 feat: Add initial IPTV support with a dedicated player, series detail screen, Xtream API service, and a streaming API handler. 2025-12-15 22:09:21 +01:00
Michael 3f9a88c09a feat: Implement Xtream Codes IPTV streaming, VOD transcoding, and content browsing UI with a dedicated web player. 2025-12-15 21:18:36 +01:00
Michael 2c0725590e feat: Add initial IPTV player with web-based playback and streaming API. 2025-12-15 13:01:24 +01:00
Michael 2eb3304a2b feat: introduce Xtream Codes API service for IPTV content access and streaming. 2025-12-14 21:48:37 +01:00
Michael ee707d3cf9 feat: implement IPTV player screen for live, VOD, and series streams with integrated controls and state management. 2025-12-14 18:47:00 +01:00
Michael a7ca1a087f feat: add Xtream service for IPTV integration and a lite player HTML file. 2025-12-14 16:43:23 +01:00
Michael b2298a9bf4 feat: Add initial IPTV player with HLS.js and mpegts.js support, including UI and parent communication. 2025-12-14 16:05:30 +01:00
Michael 5b0ae63290 feat: Add Xtream Codes API service for managing playlists, streams, and channels, including caching and proxy handling. 2025-12-14 09:13:53 +01:00
Michael 0644f376db feat: implement Xtream Codes API service for managing IPTV connections, streams, and channel data. 2025-12-14 00:17:13 +01:00
Michael e95fdb534a feat: add new UI tabs for movies and series, including mobile-specific versions with search and pagination. 2025-12-08 20:43:41 +01:00
Michael 6ee7fa178a feat: Add movies tab with pagination, search, and player integration. 2025-12-06 20:45:04 +01:00
Michael ebbf9217fc feat: add LiveTVTab widget for displaying categorized live TV channels with pagination. 2025-12-06 15:28:05 +01:00
Michael e3c3fad058 feat: Implement initial Xtream IPTV features including API service, models, and UI for live TV, movies, series, and settings. 2025-12-06 12:45:43 +01:00
Michael 39dabfa7b5 feat: add Dart server for API, Xtream proxy, and FFmpeg streaming, updating Dockerfile for ffmpeg support. 2025-12-06 11:49:39 +01:00
Michael 62ba2d33b9 feat: Implement Xtream service for IPTV API integration and add a web player. 2025-12-06 11:34:47 +01:00
Michael 120bc04318 feat: add XtreamService for API communication, stream URL generation, caching, and HTTPS proxying. 2025-12-06 10:38:53 +01:00
Michael ebbc44718b feat: add Xtream Codes API service and data models for IPTV integration. 2025-12-06 02:17:00 +01:00
Michael c78012dbdd feat: implement Hive service for local data persistence, user management, and playlist configuration. 2025-12-06 01:11:43 +01:00
Michael 5943cd9587 chore: Stop explicitly copying pubspec.lock as flutter pub get generates it. 2025-12-05 18:44:45 +01:00
Michael 0ca2835cba chore: Update dependencies, switch Flutter web renderer to HTML, replace media_kit with video_player/chewie, and remove Hive volume from Docker setup. 2025-12-05 09:52:40 +01:00
Michael 2a28eb44d8 feat: Initialize XtremFlow project with core structure, IPTV features, authentication, and video player. 2025-12-05 09:17:11 +01:00