[package]
name = "pmoparadise"
version = "0.1.0"
edition = "2024"
authors = ["PMOMusic Contributors"]
description = "Rust client for Radio Paradise streaming service"
license = "MIT OR Apache-2.0"
repository = "https://github.com/yourusername/pmomusic"
keywords = ["radio", "paradise", "streaming", "music", "flac"]
categories = ["multimedia", "api-bindings"]

[dependencies]
# HTTP client pour les requêtes à l'API Radio Paradise
reqwest = { version = "0.12", features = ["json", "stream"] }

# Gestion asynchrone
tokio = { workspace = true }

# Sérialisation/Désérialisation JSON
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }

# Helpers
chrono = { workspace = true }
async-trait = { workspace = true }
sha2 = "0.10"
hex = "0.4"
tokio-util = { version = "0.7", features = ["io"] }
async-stream = "0.3"
rusqlite = { version = "0.37", features = ["bundled"] }
once_cell = "1.20"

# Gestion des erreurs
thiserror = { workspace = true }
anyhow = { workspace = true }

# Streaming de bytes
bytes = "1.5"
futures = "0.3"
flacenc = "0.5.0"

# Logging
tracing = { workspace = true }

# URL manipulation
url = "2.5"

# Audio decoding/encoding
symphonia = { version = "0.5", features = ["all"] }

# Audio decoding - claxon for FLAC streaming
claxon = "0.4"

# pmoaudio-ext with playlist support (optional for examples)
pmoaudio-ext = { path = "../pmoaudio-ext", optional = true, features = ["playlist", "http-stream", "cache-sink"] }

# Common music source traits
pmosource = { path = "../pmosource" }

# Playlist management for FIFO support
pmoplaylist = { path = "../pmoplaylist" }
pmoconfig = { path = "../pmoconfig", optional = true }

# Cache support (OBLIGATOIRE - architecture refactorisée)
pmocache = { path = "../pmocache" }
pmocovers = { path = "../pmocovers" }
pmoaudiocache = { path = "../pmoaudiocache" }

# pmoserver extension support
pmoserver = { path = "../pmoserver", optional = true }
utoipa = { version = "5.4.0", optional = true }
axum = { version = "0.8.4", optional = true }

# pmoaudio node support
pmoaudio = { path = "../pmoaudio", optional = true }
pmoflac = { path = "../pmoflac", optional = true }
pmometadata = { path = "../pmometadata", optional = true }
futures-util = { version = "0.3", optional = true }

[features]
default = ["metadata-only", "pmoconfig", "playlist"]
# Mode métadonnées seules (pas de décodage FLAC)
metadata-only = []
# Active l'API REST pmoserver
pmoserver = ["dep:pmoserver", "dep:utoipa", "dep:axum", "server"]
# Feature pour activer le support serveur (cache registry)
server = ["pmosource/server", "pmoconfig"]
# Feature pour activer le support de pmoconfig
pmoconfig = ["dep:pmoconfig"]
# Feature pour activer le support des playlists d'historique
playlist = []
# Feature cache (deprecated - toujours actif maintenant)
cache = []
# Active le support pmoaudio node (RadioParadiseStreamSource)
pmoaudio = ["dep:pmoaudio", "dep:pmoflac", "dep:pmometadata", "dep:futures-util", "dep:pmoaudio-ext"]
# Active le support complet avec playlist (pour les exemples avancés)
full = ["pmoaudio", "dep:pmoaudio-ext", "pmoconfig", "pmoserver", "playlist"]

[dev-dependencies]
# Tests
tokio-test = "0.4"
wiremock = "0.6"
# Pour les exemples avec logging
tracing-subscriber = "0.3"
# Pour l'exemple with_cache
pmocovers = { path = "../pmocovers" }
pmoaudiocache = { path = "../pmoaudiocache" }

[[example]]
name = "now_playing"
path = "examples/now_playing.rs"

[[example]]
name = "stream_block"
path = "examples/stream_block.rs"
required-features = ["full"]

[[example]]
name = "single_channel_server"
path = "examples/single_channel_server.rs"
required-features = ["full"]
