qconnect: make PlaybackSource the shared cast predicate (is_castable_to_qconnect)

is_qobuz_streamable was dead code. Add is_castable_to_qconnect as the
single source of truth and depend qconnect-core on qbz-models so the
admission gate and the cast predicate derive from one enum.

cc
This commit is contained in:
vicrodh committed 2026-06-01 01:48:42 -06:00
1 parent 34eaebd8ef
commit f3686c197a
4 files changed
+31

No files matched your search

+7
View File
@@ -61,6 +61,13 @@ impl PlaybackSource {
pub fn is_qobuz_streamable(self) -> bool {
matches!(self, Self::Qobuz)
}
/// The admission-side cast predicate. Offline-cache maps to castable (the
/// offline copy carries a valid Qobuz track id). This is the method the
/// QConnect gate consults; is_qobuz_streamable stays "streams live from Qobuz".
pub fn is_castable_to_qconnect(self) -> bool {
matches!(self, Self::Qobuz | Self::OfflineCache)
}
}
/// A reference to a piece of cover art, resolvable regardless of origin.