Commit Graph

20 Commits

Author SHA1 Message Date
Claude
ff859372cf Fix is_valid_pk to support progressive caching properly
Changes:
1. pmocache/cache_trait.rs - Fixed is_valid_pk() logic:
   - Accept files WITH completion markers (complete downloads)
   - Accept files WITHOUT markers but recent (< 60s) (downloads in progress)
   - Reject files WITHOUT markers and old (>= 60s) (failed downloads)

   This preserves progressive caching: files are valid as soon as prebuffer
   completes, without waiting for completion marker.

2. pmoupnp/cache_registry.rs - Added compatibility layer:
   - Re-exports get_audio_cache/get_cover_cache from singletons
   - Provides build_audio_url/build_cover_url for pmosource
   - Uses PMO_SERVER_URL env var for base URL

3. pmoupnp/lib.rs - Added cache_registry module to public API

This fixes "Cache entry not found" errors while maintaining progressive
caching functionality for play_and_cache example.
2025-11-07 08:09:20 +00:00
Claude
e06a8d95df Déplacer cache registry dans les crates individuelles (pattern singleton)
Au lieu d'avoir un cache_registry centralisé dans pmoupnp qui créait
des dépendances circulaires, chaque crate a maintenant son propre
singleton global :

- pmoaudiocache : register_audio_cache() + get_audio_cache()
- pmocovers : register_cover_cache() + get_cover_cache()

Changes:
- Add singleton pattern to pmoaudiocache/src/lib.rs
- Add singleton pattern to pmocovers/src/lib.rs
- Add once_cell dependency to both crates
- Update pmoplaylist to use pmoaudiocache::get_audio_cache() as fallback
- Update pmoupnp/upnp_server.rs to use register_* functions
- Update pmoupnp/lib.rs to reexport only get_* (not register_*)
- Remove pmoupnp/src/cache_registry.rs (no longer needed)

pmoupnp réexporte get_audio_cache() et get_cover_cache() pour
compatibilité avec le code existant (pmosource, etc.).
2025-11-05 20:48:52 +00:00
Claude
123bac1fdf Add register_audio_cache/register_cover_cache functions to pmoupnp
Fix "PlaylistManager not initialized" error in play_and_cache example.
The error occurred because pmoplaylist's WriteHandle calls
pmoupnp::get_audio_cache() to validate cache pks, but the global
cache registry wasn't initialized.

Changes:
- Add register_audio_cache() and register_cover_cache() functions
- Export them from pmoupnp lib.rs
- Call them in play_and_cache example after creating caches

This mirrors how UpnpServer initializes the cache registry.
2025-11-05 19:49:59 +00:00
208fe8be76 amélioration de la webapp 2025-10-20 16:18:21 +02:00
d86cfe46df Refactoring des pmosource 2025-10-18 09:38:33 +02:00
2eec78ab4f ashboard dans le webapp qui liste dynamiquement toutes les APIs OpenAPI disponibles dans PMOMusic 2025-10-17 14:36:13 +02:00
3f85067426 Sort la partie média renderer de pmoupnp pour en faire une crate independante 2025-10-16 22:00:16 +02:00
ff2e998794 API de l'éta interne sur serveur web 2025-10-10 12:27:24 +02:00
e260330877 Revue de code et refactoring 2025-10-07 08:32:48 +02:00
c4ace53ea0 Developement de la couche sspd 2025-10-06 12:13:54 +02:00
05a9c7100a Sort le serveur dans une crate pmoserver 2025-10-06 06:28:48 +02:00
11cfd3e27f lastest clean version 2025-10-06 05:59:01 +02:00
e5f5686ba1 Revenons sur les devices 2025-10-05 22:03:13 +02:00
c9d357d647 Fin du debuggage 2025-10-05 22:03:13 +02:00
4a0595ecb0 Gros refactoring 2025-10-05 22:03:13 +02:00
4f999c8a3c Començons un Mediarenderer 2025-10-05 22:03:13 +02:00
92ef3271d6 On continue l'implementation de pmoupnp 2025-10-05 22:03:13 +02:00
a23d9bf845 On reformate le code ;-) 2025-10-05 22:03:13 +02:00
c2390893b6 On essaie de faire démarer un serveur web 2025-10-05 22:03:13 +02:00
271bc76817 Developpement de la library pmoupnp 2025-10-05 21:29:10 +02:00