feat(slint): disable the Track info trigger for non-Qobuz tracks

Track info is a Qobuz-only metadata page, but it fired for local / Plex /
ephemeral playing tracks too. Add NowPlayingState.source (populated from
the QueueTrack: None coerces to "qobuz" for catalog tracks, "local" for
local files) and gate the trigger on source == "qobuz" — in the SongCard
TouchAreas (pointer cursor + click both no-op otherwise) and the PlayerBar
menu handlers.

cc
This commit is contained in:
vicrodh committed 2026-06-22 23:55:38 -06:00
1 parent 8bc7026a01
commit be8c90bb80
4 files changed
+24 -8

No files matched your search

+8
View File
@@ -1349,6 +1349,13 @@ pub(crate) async fn refresh_now_playing_meta(runtime: &Runtime, weak: &slint::We
// Ephemeral tracks have no DB row → metadata-bound actions (favorite, // Ephemeral tracks have no DB row → metadata-bound actions (favorite,
// add-to-playlist, track-info) are gated off in the UI via this flag. // add-to-playlist, track-info) are gated off in the UI via this flag.
let is_ephemeral = crate::ephemeral::is_ephemeral_id(track.id as i64); let is_ephemeral = crate::ephemeral::is_ephemeral_id(track.id as i64);
// Normalized source for the UI ("qobuz" | "local" | "plex" | ...). Qobuz
// tracks coerce a None source to "qobuz"; local tracks to "local". Gates the
// Qobuz-only Track-info trigger.
let source = track
.source
.clone()
.unwrap_or_else(|| if track.is_local { "local" } else { "qobuz" }.to_string());
let duration = track.duration_secs; let duration = track.duration_secs;
// Plex-aware: a Plex track carries a raw `/library/...` thumb path that // Plex-aware: a Plex track carries a raw `/library/...` thumb path that
// must resolve to a tokenized `PlexThumb` (from current creds) so the // must resolve to a tokenized `PlexThumb` (from current creds) so the
@@ -1517,6 +1524,7 @@ pub(crate) async fn refresh_now_playing_meta(runtime: &Runtime, weak: &slint::We
np.set_artist_id(artist_id.into()); np.set_artist_id(artist_id.into());
np.set_track_id(track_id.into()); np.set_track_id(track_id.into());
np.set_is_ephemeral(is_ephemeral); np.set_is_ephemeral(is_ephemeral);
np.set_source(source.into());
np.set_quality_tier(quality_tier.into()); np.set_quality_tier(quality_tier.into());
np.set_quality_detail(quality_detail.into()); np.set_quality_detail(quality_detail.into());
np.set_duration_secs(duration as i32); np.set_duration_secs(duration as i32);
+8 -4
View File
@@ -261,8 +261,10 @@ export component PlayerBar inherits Rectangle {
root.media-action(kind, id, "open"); root.media-action(kind, id, "open");
} }
track-info() => { track-info() => {
// Ephemeral tracks have no DB row → no track-info page. // Track info is a Qobuz-only feature — disable the
if (!NowPlayingState.is-ephemeral) { // trigger for local / Plex / ephemeral tracks (no DB row
// / no Qobuz metadata page).
if (NowPlayingState.source == "qobuz") {
root.media-action("track", NowPlayingState.track-id, "track-info"); root.media-action("track", NowPlayingState.track-id, "track-info");
} }
} }
@@ -347,8 +349,10 @@ export component PlayerBar inherits Rectangle {
root.media-action(kind, id, "open"); root.media-action(kind, id, "open");
} }
track-info() => { track-info() => {
// Ephemeral tracks have no DB row → no track-info page. // Track info is a Qobuz-only feature — disable the
if (!NowPlayingState.is-ephemeral) { // trigger for local / Plex / ephemeral tracks (no DB row
// / no Qobuz metadata page).
if (NowPlayingState.source == "qobuz") {
root.media-action("track", NowPlayingState.track-id, "track-info"); root.media-action("track", NowPlayingState.track-id, "track-info");
} }
} }
+4 -4
View File
@@ -319,10 +319,10 @@ export component SongCard inherits Rectangle {
overflow: elide; overflow: elide;
} }
tc-ta := TouchArea { tc-ta := TouchArea {
mouse-cursor: (NowPlayingState.has-track && !NowPlayingState.is-ephemeral) mouse-cursor: (NowPlayingState.has-track && NowPlayingState.source == "qobuz")
? pointer : default; ? pointer : default;
clicked => { clicked => {
if (NowPlayingState.has-track && !NowPlayingState.is-ephemeral) { if (NowPlayingState.has-track && NowPlayingState.source == "qobuz") {
root.track-info(); root.track-info();
} }
} }
@@ -431,11 +431,11 @@ export component SongCard inherits Rectangle {
overflow: elide; overflow: elide;
} }
ttta := TouchArea { ttta := TouchArea {
mouse-cursor: (NowPlayingState.has-track && !NowPlayingState.is-ephemeral) mouse-cursor: (NowPlayingState.has-track && NowPlayingState.source == "qobuz")
? pointer : default; ? pointer : default;
clicked => { clicked => {
// Ephemeral tracks have no track-info page. // Ephemeral tracks have no track-info page.
if (NowPlayingState.has-track && !NowPlayingState.is-ephemeral) { if (NowPlayingState.has-track && NowPlayingState.source == "qobuz") {
root.track-info(); root.track-info();
} }
} }
+4
View File
@@ -3635,6 +3635,10 @@ export global NowPlayingState {
// True when the playing track is from an ephemeral folder (synthetic id): // True when the playing track is from an ephemeral folder (synthetic id):
// it has no DB row, so favorite / add-to-playlist / track-info are gated off. // it has no DB row, so favorite / add-to-playlist / track-info are gated off.
in property <bool> is-ephemeral: false; in property <bool> is-ephemeral: false;
// Playing track's source: "qobuz" | "local" | "plex" | "ephemeral". Track
// info is a Qobuz-only feature, so its trigger is gated on `source ==
// "qobuz"` (local/Plex/ephemeral tracks have no Qobuz metadata page).
in property <string> source;
// Parental-warning / explicit flag for the playing track. Drives the // Parental-warning / explicit flag for the playing track. Drives the
// explicit badge in the miniplayer compact + artwork surfaces (Tauri parity). // explicit badge in the miniplayer compact + artwork surfaces (Tauri parity).
in property <bool> explicit: false; in property <bool> explicit: false;