Plex cover images were fetched full-res on every surface (Slint built the raw
/library/.../thumb URL), where Tauri requests a server-transcoded thumb sized to
the render target. On a real library this made the views feel heavy and starved
the LAN bandwidth that track playback needs.
- qbz-models: ArtworkRef::PlexThumb gains a size: Option<u32>; new plex_thumb_url()
emits the Tauri-format transcode URL when Some
(/photo/:/transcode?url={enc}&width=N&height=N&minSize=1&X-Plex-Token=), raw
tokenized path when None (album/MPRIS full-res preserved). urlencoding dep added
to match encodeURIComponent. Tests extended.
- qbz-slint: each PlexThumb construction site passes its surface decode size
(grid/detail 264, queue/now-playing-item 96, now-playing bar 160, MPRIS full-res);
fetch_and_decode_ref uses plex_thumb_url.
- artwork.rs: static LazyLock<reqwest::Client> reused in fetch_cached_http instead
of reqwest::get (per-image client) — keep-alive + no fd churn (EMFILE smell).
Audio path untouched; local/Qobuz artwork unchanged.
cc
31 lines
756 B
TOML
31 lines
756 B
TOML
[package]
|
|
name = "qbz-models"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Shared types, events, and traits for QBZ music player"
|
|
|
|
[dependencies]
|
|
# Serialization
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
|
|
# Async
|
|
async-trait = { workspace = true }
|
|
|
|
# Logging
|
|
log = { workspace = true }
|
|
|
|
# Error handling
|
|
thiserror = { workspace = true }
|
|
|
|
# Time
|
|
chrono = { workspace = true }
|
|
|
|
# Correct file:// URI building for media-controls art (ArtworkRef::to_mpris_url)
|
|
url = "2"
|
|
# Percent-encoding the Plex transcode `url=`/token params (plex_thumb_url),
|
|
# matching the Tauri frontend's buildPlexArtworkUrl. Same crate used across
|
|
# qbz-slint / qbz-media-controls / qbz-integrations.
|
|
urlencoding = "2"
|