64 lines
2.5 KiB
Markdown
64 lines
2.5 KiB
Markdown
# Modèle de données - Radio Live
|
|
|
|
📖 Voir [Règles métier - Section 12 : Radio Live](../rules/radio-live.md) | [Entités globales](../../_shared/entities/entities-overview.md)
|
|
|
|
## Diagramme
|
|
|
|
```mermaid
|
|
erDiagram
|
|
LIVE_STREAMS }o--|| USERS : "diffusé par"
|
|
LIVE_STREAMS ||--o{ LIVE_RECORDINGS : "enregistrement"
|
|
LIVE_STREAMS ||--o{ LIVE_LISTENERS : "auditeurs"
|
|
|
|
LIVE_LISTENERS }o--|| USERS : "écoute"
|
|
LIVE_LISTENERS }o--|| LIVE_STREAMS : "stream"
|
|
|
|
LIVE_STREAMS {
|
|
uuid id PK
|
|
uuid creator_id FK
|
|
string title
|
|
string[] tags
|
|
string age_rating
|
|
string geo_type
|
|
jsonb geo_data
|
|
string status
|
|
string stream_key
|
|
string playback_url
|
|
int current_listeners_count
|
|
int peak_listeners_count
|
|
timestamp started_at
|
|
timestamp ended_at
|
|
int duration_seconds
|
|
}
|
|
|
|
LIVE_RECORDINGS {
|
|
uuid id PK
|
|
uuid stream_id FK
|
|
string audio_url
|
|
int duration_seconds
|
|
int file_size_bytes
|
|
string status
|
|
boolean auto_publish
|
|
timestamp recorded_at
|
|
timestamp processed_at
|
|
}
|
|
|
|
LIVE_LISTENERS {
|
|
uuid id PK
|
|
uuid stream_id FK
|
|
uuid user_id FK
|
|
int listen_duration_seconds
|
|
boolean was_notified
|
|
timestamp joined_at
|
|
timestamp left_at
|
|
}
|
|
```
|
|
|
|
## Légende
|
|
|
|
**Entités radio live** :
|
|
|
|
- **LIVE_STREAMS** : Streams audio temps réel - Status : `preparing` (buffer 15s initial), `live` (diffusion publique), `ended`, `interrupted` - Stream_key : WebRTC ingestion unique par créateur - Playback_url : HLS m3u8 pour diffusion clients - Geo_type : `city`, `department`, `region`, `national` (zone diffusion) - Durée max 8h par session - Déconnexion <60s : reconnexion auto, ≥60s : arrêt auto - Notification push abonnés dans zone géo au démarrage
|
|
- **LIVE_RECORDINGS** : Enregistrements replay auto - Enregistrement obligatoire et automatique pendant live - Status : `recording`, `processing` (transcode HLS), `published`, `deleted` - Auto_publish : true par défaut (créateur peut désactiver) - Processing : Job asynchrone FFmpeg (Opus → HLS segments) - Replay disponible sous 5-15 min après fin live
|
|
- **LIVE_LISTENERS** : Auditeurs live - Join/leave tracking temps réel - Was_notified : true si reçu push notification (analyse efficacité) - Listen_duration : Temps écoute effectif (pour stats créateur) - Peak listeners : Maximum simultané (métrique clé engagement)
|