mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-20 05:28:05 +02:00
Guide TV : régionales France 3, variantes de nom, chaînes +1, CH et BE
Mesuré en prod après le premier correctif : 69 chaînes sur 149 avec guide. Les vides restantes relevaient surtout de formes de nom que le dump écrit autrement, ou de pays non couverts : - « F3 ALPES » → France 3 Alpes (France.3.-.Alpes.fr) : F2 à F5 développés - clé souple en dernier recours, dans son propre espace de noms : sans code pays ni « channel/tv/hd » (« AB3 » → AB3.Channel.fr) - chaîne « +1 » absente du dump (TF1 +1) : guide de la chaîne principale décalé d'une heure ; une +1 qui a son propre guide le garde - sources par défaut : FR1 puis CH1 (RTS…) et BE2 (même fournisseur), le dump français reste prioritaire Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ea60ccbfa
commit
4d00409de8
6 files changed
+151
-13
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
@@ -84,6 +85,52 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('correspondances élargies (chaînes vides mesurées en prod)', () {
|
||||
XmltvEpgService serviceWith(String dump) => XmltvEpgService(
|
||||
sourceUrls: const ['http://ext/epg.xml'],
|
||||
client: MockClient((_) async => http.Response.bytes(
|
||||
// Octets UTF-8 : les ids réels portent des accents.
|
||||
const Utf8Encoder().convert(dump),
|
||||
200,
|
||||
)),
|
||||
);
|
||||
|
||||
String channel(String id, String name, String title, DateTime start) => '''
|
||||
<channel id="$id"><display-name>$name</display-name></channel>
|
||||
<programme start="${_stamp(start)}" stop="${_stamp(start.add(const Duration(hours: 1)))}" channel="$id"><title>$title</title></programme>''';
|
||||
|
||||
test('« F3 ALPES » du panneau trouve France.3.-.Alpes.fr', () async {
|
||||
final now = DateTime.now().toUtc();
|
||||
final svc = serviceWith('<tv>${channel('France.3.-.Alpes.fr', 'France 3 Alpes', 'JT Alpes', now)}</tv>');
|
||||
final hits = await svc.programmesFor(null, displayName: 'FR - F3 ALPES HD');
|
||||
expect(hits.single.title, 'JT Alpes');
|
||||
});
|
||||
|
||||
test('« AB3 » trouve AB3.Channel.fr (clé souple)', () async {
|
||||
final now = DateTime.now().toUtc();
|
||||
final svc = serviceWith('<tv>${channel('AB3.Channel.fr', 'AB3 Channel', 'Série', now)}</tv>');
|
||||
final hits = await svc.programmesFor('AB3.fr', displayName: 'FR - AB3 FHD');
|
||||
expect(hits.single.title, 'Série');
|
||||
});
|
||||
|
||||
test('« TF1 +1 » reprend le guide de TF1 décalé d\'une heure', () async {
|
||||
final now = DateTime.now().toUtc();
|
||||
final svc = serviceWith('<tv>${channel('TF1.fr', 'TF1', 'Le 13h', now)}</tv>');
|
||||
final hits = await svc.programmesFor(null, displayName: 'FR - TF1 +1 FHD');
|
||||
expect(hits.single.title, 'Le 13h');
|
||||
expect(hits.single.start, now.add(const Duration(hours: 1)).copyWith(microsecond: 0, millisecond: 0));
|
||||
});
|
||||
|
||||
test('une chaîne +1 qui a son propre guide le garde', () async {
|
||||
final now = DateTime.now().toUtc();
|
||||
final svc = serviceWith('<tv>'
|
||||
'${channel('Boomerang.fr', 'Boomerang', 'Normal', now)}'
|
||||
'${channel('Boomerang.+1.fr', 'Boomerang +1', 'Décalé', now)}</tv>');
|
||||
final hits = await svc.programmesFor(null, displayName: 'FR - BOOMERANG +1');
|
||||
expect(hits.single.title, 'Décalé');
|
||||
});
|
||||
});
|
||||
|
||||
group('programmesFor par nom', () {
|
||||
test('trouve le guide d\'une chaîne sans epg_channel_id par son nom nettoyé',
|
||||
() async {
|
||||
|
||||
Reference in new issue
Block a user