From ec99065cdf830ad1146b1a600f5677ba5523fd38 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Sun, 19 Jul 2026 13:14:38 -0700 Subject: [PATCH] ios: hide progress controls for live streams --- ios/QueueCube/Views/NowPlayingMiniView.swift | 2 +- ios/QueueCube/Views/NowPlayingView.swift | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ios/QueueCube/Views/NowPlayingMiniView.swift b/ios/QueueCube/Views/NowPlayingMiniView.swift index 9db01a7..87220d1 100644 --- a/ios/QueueCube/Views/NowPlayingMiniView.swift +++ b/ios/QueueCube/Views/NowPlayingMiniView.swift @@ -61,7 +61,7 @@ struct NowPlayingMiniView: View { } .padding(EdgeInsets(top: 4.0, leading: 14.0, bottom: 4.0, trailing: 10.0)) - if model.playbackDuration != nil { + if model.seekablePlaybackDuration != nil { TimelineView(.periodic(from: .now, by: 1.0)) { context in ProgressView(value: model.playbackProgress(at: context.date) ?? 0.0) .progressViewStyle(.linear) diff --git a/ios/QueueCube/Views/NowPlayingView.swift b/ios/QueueCube/Views/NowPlayingView.swift index 4e57853..29e3a2e 100644 --- a/ios/QueueCube/Views/NowPlayingView.swift +++ b/ios/QueueCube/Views/NowPlayingView.swift @@ -40,6 +40,11 @@ class NowPlayingViewModel return duration } + var seekablePlaybackDuration: Double? { + guard isSeekable else { return nil } + return playbackDuration + } + var displayedPlaybackPosition: Double { displayedPlaybackPosition(at: .now) } @@ -55,8 +60,8 @@ class NowPlayingViewModel } func playbackProgress(at date: Date) -> Double? { - guard let playbackDuration else { return nil } - return displayedPlaybackPosition(at: date) / playbackDuration + guard let seekablePlaybackDuration else { return nil } + return displayedPlaybackPosition(at: date) / seekablePlaybackDuration } func syncPlaybackPosition(_ position: Double?, duration: Double?, isPlaying: Bool, isSeekable: Bool) { @@ -108,7 +113,7 @@ struct NowPlayingView: View Spacer(minLength: 20.0) - if let duration = model.playbackDuration { + if let duration = model.seekablePlaybackDuration { TimelineView(.periodic(from: .now, by: 1.0)) { context in VStack(spacing: 2.0) { Slider( @@ -116,7 +121,7 @@ struct NowPlayingView: View in: 0.0...duration, onEditingChanged: playbackPositionEditingChanged ) - .disabled(!model.isSeekable || nothingQueued) + .disabled(nothingQueued) HStack { Text(formatTime(model.displayedPlaybackPosition(at: context.date)))