[package]
name = "pmoqobuz"
version = "0.1.0"
edition = "2021"

[dependencies]
regex = "1.12"
base64 = "0.22"
indexmap = "2.0"
async-trait = { version = "0.1", optional = true }

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

# Gestion asynchrone
tokio = { version = "1", features = ["full"] }

# Sérialisation/Désérialisation JSON
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"

# Gestion des erreurs
anyhow = "1.0"
thiserror = "2.0"

# Hashing pour les clés de cache et signatures
sha1 = "0.10"
hex = "0.4"
md-5 = "0.10"

# Cache en mémoire avec TTL
moka = { version = "0.12", features = ["future"] }

# Logging
tracing = "0.1"

# Gestion du temps
chrono = { version = "0.4", features = ["serde"] }

# Configuration
pmoconfig = { path = "../pmoconfig" }

# Intégration avec pmocovers pour le cache d'images (OBLIGATOIRE)
pmocovers = { path = "../pmocovers" }

# Intégration avec pmoaudiocache pour le cache audio (OBLIGATOIRE)
pmoaudiocache = { path = "../pmoaudiocache" }

# Intégration avec pmodidl pour l'export DIDL
pmodidl = { path = "../pmodidl" }

# Intégration avec pmoserver pour l'API HTTP
pmoserver = { path = "../pmoserver", optional = true }
axum = { version = "0.8", optional = true }
rusqlite = { version = "0.37", features = ["bundled"], optional = true }

# Documentation OpenAPI
utoipa = { version = "5.3", optional = true }

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

# Playlist management
pmoplaylist = { path = "../pmoplaylist" }
pmocache = { path = "../pmocache" }

[features]
default = ["async-trait-support"]
# Feature pour activer les extensions pmoserver
pmoserver = ["dep:pmoserver", "dep:axum", "dep:utoipa"]
# Feature pour activer le support serveur (cache registry)
server = ["pmosource/server"]
# Feature cache (deprecated - toujours actif maintenant)
cache = []
async-trait-support = ["dep:async-trait"]
disk-cache = ["dep:rusqlite", "dep:async-trait"]

[dev-dependencies]
# Tests
tokio-test = "0.4"
mockito = "1.0"
tempfile = "3.0"
# Pour les exemples
tracing-subscriber = "0.3"
# Pour l'exemple spoofer

# Specify that the with_cache example requires the cache feature
[[example]]
name = "with_cache"
required-features = ["cache"]
