Commit Graph

7 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
ee9dca75ba ebuggage transcodage audio en flac 2025-10-20 16:18:21 +02:00
ff515e22bd nouveau mediarenderer 2025-10-18 14:33:52 +02:00
d86cfe46df Refactoring des pmosource 2025-10-18 09:38:33 +02:00