Commit Graph

52 Commits

Author SHA1 Message Date
009545de40 feat(media): enhance source routing and add playlist caching
Update UrlSource::new() to accept a base_url parameter for relative path resolution. Extend the Qobuz router with Playlist and Artist variants to fetch metadata and construct DIDL containers. Introduce an in-memory PlaylistStore cache, refactor search() and browse() to route and cache dynamic playlist items, and add helper utilities for deterministic ID generation.
2026-06-21 15:09:22 +02:00
bfa6231b1d feat: add async get_container and parallelize source browsing
Introduce an async `get_container` method across source implementations to fetch lightweight container metadata efficiently. Add the `futures` crate as a dependency to enable concurrent operations. Refactor the `browse` flow to short-circuit ephemeral IDs and delegate metadata resolution to `get_container`. Update the RadioFrance handler to scrape episode pages in parallel, bypassing limited RSS feeds and improving overall browsing performance.
2026-06-21 15:06:31 +02:00
d49bb604ca feat: add UrlSource for arbitrary URL-based media playback
Introduces the pmourlsource crate as a standard MusicSource that resolves HTTP/HTTPS URLs via a priority-ordered UrlHandler registry. Includes specialized handlers for Qobuz and Radio France alongside an SSRF-safe generic scraper supporting playlists, feeds, and HTML audio. Integrates with existing browse flows, REST endpoints, and Android Web Share targets while updating source capability flags to correctly route URL queries.
2026-06-21 15:01:51 +02:00
0dab3077cf feat: unify search state and dynamic container routing
Refactor search handling across the frontend and backend to use a unified reactive state and dynamic container ID generation. The frontend now leverages a centralized `useMediaServers` composable for search queries and results, while the backend computes container IDs dynamically from source entries instead of using hardcoded values. Bumps version to 0.3.52.
2026-06-11 22:17:53 +02:00
8179c0e239 refactor: rework search implementation and fix navigation bug
Replaces raw string queries with structured `SearchQuery` types across the `MusicSource` trait and UPnP handlers. Adds dedicated paginated endpoints, explicit caching, and type-specific filtering for the Qobuz source. Fixes a frontend navigation bug by aligning state management with UPnP browse semantics and properly routing virtual container IDs. Also updates the Makefile for dynamic `RUST_LOG` configuration, standardizes logging with `tracing`, and adds the dependency lockfile.
2026-06-11 22:02:38 +02:00
1d3a9379a1 feat(qobuz): implement concurrent playlist pagination
Parallelize Qobuz playlist track fetching by increasing the page size to 500 and processing remaining pages concurrently via `futures::try_join_all` with a configurable semaphore (default 3). Results are offset-sorted to preserve original order. Adds a `page_concurrency` configuration option, updates the API client initialization, and introduces the `futures` dependency. This reduces large playlist latency from ~1.6s to ~0.7s.
2026-06-11 15:11:12 +02:00
a30186485f feat: make qobuz register concurrency configurable
Replace the hardcoded semaphore capacity of 16 with a configurable `register_concurrency` setting (defaulting to 4). This mitigates SQLite write contention and optimizes concurrent API and network requests during parallel track caching.
2026-06-11 14:49:44 +02:00
bcfffa6df8 feat: implement batch track loading via track/getList endpoint
Replaces sequential track requests with a chunked batch enrichment workflow using MD5-signed POST requests (50-ID windows). Introduces cache-first fetching, order preservation via HashMap lookups, and graceful fallbacks for playlist and favorite loading.
2026-06-11 11:07:09 +02:00
e670e8e0d8 feat: enhance Qobuz bundle extraction with caching and retry logic
Refactor Qobuz bundle fetching to improve resilience and performance. Add HTTP timeout and retry configuration, and implement a retry loop that returns version metadata. Introduce bundle version caching and persistence to skip redundant extractions when the bundle remains unchanged. Replace console logging with structured tracing macros and update the architectural tracking document to mark these improvements as complete.
2026-06-11 09:51:15 +02:00
c7f67e7c7c feat(pmoqobuz): add progressive CMAF FLAC streaming support
Introduce a `/tracks/:id/flac` endpoint and `open_cmaf_stream` client method to enable incremental decryption and caching of FLAC audio. Refactor segment decryption into a reusable helper and stream decrypted frames via a bounded tokio channel. Add `tokio-util` as an optional dependency, update the `pmoserver` feature, and implement conditional routing for local proxy versus direct API access. Update the architecture roadmap to document these improvements.
2026-06-11 09:43:44 +02:00
a97bfe6148 feat: implement Qobuz CMAF streaming and AES decryption
Introduces a new CMAF streaming module for Qobuz that handles progressive segment fetching and full-track decryption. The implementation adds HKDF session key derivation, AES-128-CBC key unwrapping, and AES-128-CTR frame decryption, alongside an ISO BMFF parser for extracting FLAC headers and segment metadata. It also integrates automatic session renewal with double-checked locking, a generic async retry mechanism for transient HTTP errors, and centralized error handling. Finally, it exposes `CmafStreamInfo` and async streaming methods in the public API, updating cryptographic dependencies accordingly.
2026-06-11 08:52:28 +02:00
fe9dd9aba6 ♻️ refactor(pmowebrenderer): factoriser handlers et supprimer duplications
- Remplacer les Arc+Box::pin manuels par la macro action_handler!(captures(...))
- Supprimer helpers locaux dupliqués dans renderer.rs (add_var, add_action)
- Extraire handlers génériques pour GET requests
- Factoriser extraction metadata dans set_uri_handler /set_next_uriHandler  
- Simplifier build_renderingcontrol en retirant pipeline inutile
- Mettre à jour edition Rust de 2021 vers 2024 dans tous les Cargo.toml
- Corriger pattern matching inutile `ref` sur déréférencement dans pmoaudio et pmoflac
2026-04-05 14:09:46 +02:00
6352a43e27 correct compilation warning in pmoqobuz 2026-04-04 00:34:55 +02:00
843f474a98 feat: ajouter la recherche dans les serveurs media
Implémente une fonctionnalité de recherche pour les serveurs media (Qobuz et autres) avec:
- Nouvelle API endpoint /servers/{serverId}/search côté backend
- Fonction searchServer dans useMediaServers.ts pour gérer la requête
- Composants MediaBrowser.vue et ServerDrawer.vue avec barre de recherche interactive
- Support des résultats mixtes (albums, artistes, pistes, playlists)
- Gestion des états de chargement, erreur et résultat vide
- Affichage conditionnel selon le mode navigation/recherche
2026-03-30 06:36:32 +02:00
36f0ac5122 Bump version to 0.3.28 and update schema
- Increment package and version.txt to v0.3.28
- Update pmocache schema version from 1 to 2
- Add warning and source_version invalidation when Qobuz playlist track registration is incomplete
2026-03-25 15:10:01 +01:00
5095dd6964 feat(cache): fix lazy PK metadata resolution and playlist track ordering
- In `track_metadata.rs`, implement fallback logic for lazy PKs: first try real_pk, then fallback to lazy_pk for metadata keys seeded before download.
- In `db.rs`, add debug logging after migration to track remaining metadata under lazy_pk.
- In `source.rs` (Qobuz):
  - Detect and repair playlists with missing cache entries by forcing refresh when `items.len() < total`.
  - Preserve original track order after parallel processing by attaching and sorting on original index.
  - Handle missing performer/cover gracefully with warnings and provider fallback.
- In `metadata_cache.rs` (Radio France), simplify logging and improve test coverage for expiration logic.
- In `cache.rs`, add debug/warning logs when metadata or cover seeding fails during lazy caching.
2026-03-25 12:25:43 +01:00
dc062f8a3e refactor: replace cache_covers with register_tracks_lazy for playlist processing
Replace the old `cache_covers` approach with a new `register_tracks_lazy` method that handles track registration for lazy playback in playlists. The new implementation avoids expensive `get_stream_url` calls by deferring audio URL resolution to `QobuzLazyProvider`, caches covers in parallel with concurrency limited via semaphore (16), and stores full metadata including cover PKs. This significantly improves performance for large playlists while preserving all necessary track metadata.
2026-03-25 11:29:37 +01:00
0137a4675f feat: add Qobuz playlist caching with versioning and infinite scroll UI
- Add qobuz_debug to .gitignore
- Bump PMOMusic version to 0.3.26
- Add .cargo/ copy in Dockerfile for registry config
- Implement infinite scroll in ServerDrawer.vue with IntersectionObserver and sentinel element
- Add source/source_version fields to playlists for cache invalidation
- Update pmocache and pmoplaylist DB schemas with versioning (SCHEMA_VERSION)
- Add Qobuz API metadata fetching and pagination for playlist tracks
- Implement album/playlist cache invalidation based on released_at/updated_at timestamps
- Refactor adapt_playlist_items_to_qobuz → adapt_items_to_qobuz with cleaner logic
- Add debug mode to save Qobuz API responses when QOBUZ_DEBUG_DIR is set
2026-03-25 11:08:28 +01:00
76b7c126c2 refactor: replace absolute URLs with route-based cover URLs and generalize caching
- Remplacer les appels à `covers_absolute_url_for` par `covers_route_for` pour générer des URLs relatives basées sur les routes
- Introduire le trait `CoverCacheable` pour généraliser le cache des covers (Album, Playlist, Artist, Track)
- Remplacer les fonctions spécifiques (`cache_album_covers`, etc.) par une fonction générique `cache_covers`
- Simplifier le code en unifiant la logique de mise en cache des covers
- Corriger l'initialisation de `PMO_SERVER_URL` pour utiliser `base_url()` (incluant le port) au lieu d'une URL brute
2026-03-24 15:02:28 +01:00
1164a11410 feat(cache): centralize absolute URL generation with PMO_SERVER_URL
Replace hardcoded relative URLs and manual base_url concatenation with a unified absolute URL API via pmocache::covers_absolute_url_for() and CacheTrait::absolute_url_for().

- Add pmocache as a required dependency to pmoparadise
- Introduce absolute_url_for() and covers_absolute_url_for() helpers using PMO_SERVER_URL env var (default: http://localhost:8080)
- Update all callers to use absolute URLs for covers and audio in streaming, playlists, Qobuz, Radio France, UPnP, and server startup
- Remove redundant route_for() usage in URL construction
- Add pmocache to Cargo.lock
2026-03-24 12:03:07 +01:00
b690420550 feat: add parallel cover caching and refactor browse methods
Introduce async helper methods `cache_album_covers` and `cache_playlist_covers` to cache album/playlist covers in parallel using JoinSet. Refactor browse functions for favorites, discover, and genre pages to reuse these helpers and avoid duplicate logic. Simplify cover URL resolution by unifying caching path and removing redundant base URL concatenation.
2026-03-24 11:24:02 +01:00
0f0a8d1c91 deps: update esbuild to 0.27.4, rollup to 4.60.0, vite to 7.3.1
deps: update esbuild to 0.27.4, rollup to 4.60.0, vite to 7.3.1

- bump esbuild and all platform-specific binaries from 0.25.10 to 0.27.4
- bump rollup and all platform-specific binaries from 4.52.3 to 4.60.0
- bump vite from 7.1.7 to 7.3.1 (esbuild peer dep updated to ^0.27.0)
- bump dompurify from 3.2.7 to 3.3.3

web: improve cover image retry logic
- increase maxRetries default from 3 to 5
- reduce initial retryDelay from 1000ms to 500ms
- implement exponential backoff: delay = retryDelay * 2^(retryCount - 1)
- add detailed logging for retries and final failure

rust: minor cleanup
- remove unused imports (watch, Url, AudioSegment, SyncMarker)
- add tracing debug logs for cache file requests
- handle missing files gracefully with warning + client retry hint
- add #[allow(async_fn_in_trait)] where needed
2026-03-24 10:49:47 +01:00
5c5e1d534b feat: Implémentation complète de la source Radio France avec intégration UPnP et serveur HTTP
Ajout de la source Radio France avec :
- Implémentation du trait MusicSource pour l'intégration UPnP
- Routes HTTP API REST pour l'accès aux stations et flux AAC
- Proxy streaming avec tracking des connexions
- Génération dynamique de l'arborescence UPnP
- Cache multi-niveaux (stations, métadonnées, covers)
- Support des ~70 stations (standalone, groupes, radios ICI)

Fichiers créés :
- pmoradiofrance/src/source.rs (implémentation MusicSource)
- pmoradiofrance/src/server_ext.rs (routes HTTP et proxy streaming)
- pmoradiofrance/assets/radiofrance-logo.webp (logo placeholder)

Fichiers modifiés :
- pmoradiofrance/src/lib.rs (re-exports et modules)
- pmoradiofrance/Cargo.toml (dépendances server)
- Cargo.toml (workspace)
- pmomediaserver/Cargo.toml (feature radiofrance)
- PMOMusic/Cargo.toml (feature radiofrance)
- PMOMusic/src/main.rs (enregistrement automatique)

Tests et validation : compilation OK, pattern respecté, feature-gating cohérent
2026-01-23 12:20:43 +01:00
41a4f0eaea Fix bug play single track Qobuz
Corrige le bug empêchant la lecture d'un track Qobuz individuel depuis le ServerDrawer.

- Implémente `get_item()` dans `QobuzSource` pour retourner des URLs HTTP valides au lieu de URLs symboliques
- Rend `format_duration()` publique dans `pmoqobuz/src/didl.rs`
- Ajoute le logging dans `pmocontrol/src/pmoserver_ext.rs` pour suivre le flux de lecture
- Améliore la gestion des objets dans `pmocontrol/src/pmoserver_ext.rs` pour distinguer les conteneurs des éléments
2026-01-17 08:36:23 +01:00
066e2fe008 Corrige le bug d'URL relative pour la cover dans pmoqobuz
Correction du bug où l'URL de la cover générée par pmoqobuz était relative au lieu d'être absolue, comme pour le flux audio. Ajout de la conversion de l'URL de la cover en URL absolue dans la fonction adapt_playlist_items_to_qobuz. Version mise à jour de 0.3.5 à 0.3.6.
2026-01-16 23:35:07 +01:00
7546072d2b Correction de petits bugs d'interface 2026-01-04 20:45:51 +01:00
02a44e9e75 Debug playlist lecture 2025-12-28 16:31:02 +01:00
2f77913caa Enrichissement de la source Qobuz 2025-12-28 15:00:06 +01:00
2b69350162 Debug qobuz pas encore parfait mais mieux 2025-12-28 13:52:31 +01:00
876b1e0147 update de qobuz pour utiliser les sources lazy 2025-12-28 12:37:10 +01:00
1bf34fe949 no local cache 2025-12-17 14:25:24 +01:00
ca36a102e5 Amélioration des pmoplaylist 2025-12-17 08:47:07 +01:00
68e6f528e5 debugage lazy cache 2025-12-17 07:23:25 +01:00
d2d8111668 lazy cache webapp 2025-12-15 15:01:14 +01:00
90399b408a correction for lazy playlist and lazy cache 2025-12-15 12:17:33 +01:00
4bc80dfd08 PMOQobuz client is now working 2025-12-15 10:56:04 +01:00
d2f6abf4bb Big Debug of PMOQobuz step 3 2025-12-14 20:39:08 +01:00
50693aaf7a Big Debug of PMOQobuz step 2 2025-12-13 13:56:55 +01:00
cd19d68703 Big debug of pmoqobuz step 1 2025-12-13 13:32:27 +01:00
76132086b6 on avance un peu pmoqobuz 2025-12-11 21:35:17 +00:00
785f8d52a5 Update la web app pour tirer partie du nouveau systeme de cache 2025-10-29 22:36:36 +01:00
ea6dd03ac0 Je ne sais pas trop 2025-10-29 22:35:53 +01:00
ecb362ae48 refactoring des caches 2025-10-25 17:46:53 +02:00
208fe8be76 amélioration de la webapp 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
082914cf8c Refactoring manuel 2025-10-17 19:28:04 +02:00
d64b96cef4 complète le trait MusicSource 2025-10-17 08:37:28 +02:00
ee1072a491 ajoute à pmoqobuz la feature cache 2025-10-17 08:01:50 +02:00
b22a82bb50 Crée la crate pmoplaylist 2025-10-17 07:47:39 +02:00