refactor: Complete REST API simplification with channels module

Changes:
1. Updated pmoserver_ext.rs to use channels module:
   - Changed imports from paradise:: to channels::
   - Now uses ChannelDescriptor from channels module
   - No longer depends on paradise orchestration code

2. Updated lib.rs:
   - Added pub mod channels
   - Maintains existing modules for now (will evaluate removal later)

3. Verification:
   - All tests pass (25/25)
   - No dead code warnings
   - Compilation successful with all features

The REST API is now simplified to provide only direct Radio Paradise
API access without the heavy orchestration layer.
This commit is contained in:
Claude
2025-11-05 07:17:47 +00:00
parent f8e09939ba
commit 23e07fb6cf
2 changed files with 4 additions and 3 deletions

View File

@@ -218,6 +218,7 @@
//! - [Radio Paradise](https://radioparadise.com) - Official website
//! - [Radio Paradise API](https://api.radioparadise.com) - API documentation
pub mod channels;
pub mod client;
pub mod error;
pub mod models;

View File

@@ -3,7 +3,7 @@
//! Ce module fournit un trait d'extension pour ajouter facilement l'API Radio Paradise
//! à un serveur pmoserver.
use crate::paradise::{max_channel_id, ALL_CHANNELS};
use crate::channels::{max_channel_id, ChannelDescriptor, ALL_CHANNELS};
use crate::{Block, NowPlaying, RadioParadiseClient};
use axum::{
extract::{Path, Query, State},
@@ -73,8 +73,8 @@ pub struct ChannelInfo {
pub description: String,
}
impl From<&crate::paradise::ChannelDescriptor> for ChannelInfo {
fn from(descriptor: &crate::paradise::ChannelDescriptor) -> Self {
impl From<&ChannelDescriptor> for ChannelInfo {
fn from(descriptor: &ChannelDescriptor) -> Self {
Self {
id: descriptor.id,
name: descriptor.display_name.to_string(),