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:
4 files changed
+31
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user