Minor improvements

This commit is contained in:
Arkadiusz Fal 2022-12-19 13:45:41 +01:00
parent d80929bd88
commit 16e365ce6c
7 changed files with 19 additions and 17 deletions

View File

@ -91,8 +91,6 @@ extension PlayerModel {
watch.watchedAt = Date()
try? self.backgroundContext.save()
FeedModel.shared.calculateUnwatchedFeed()
}
}

View File

@ -664,6 +664,10 @@ final class PlayerModel: ObservableObject {
}
func handleCurrentItemChange() {
if currentItem == nil {
FeedModel.shared.calculateUnwatchedFeed()
}
#if os(macOS)
Windows.player.window?.title = windowTitle
#endif

View File

@ -35,7 +35,7 @@ final class WatchNextViewModel: ObservableObject {
static let shared = WatchNextViewModel()
@Published var item: PlayerQueueItem?
@Published private(set) var isPresenting = true
@Published private(set) var isPresenting = false
@Published var reason: PresentationReason?
@Published var page = Page.queue

View File

@ -21,20 +21,18 @@ struct PlayerOverlayModifier: ViewModifier {
@ViewBuilder var overlay: some View {
Group {
if player.videoForDisplay != nil {
ControlsBar(fullScreen: .constant(false), expansionState: $expansionState, playerBar: true)
.offset(x: expansionState == .mini && !controlsWhenMinimized ? 10 : 0, y: 0)
.transition(.opacity)
.frame(maxWidth: maxWidth, alignment: .trailing)
.onAppear {
if playerButtonIsExpanded {
expansionState = .full
}
}
.animation(.easeIn, value: player.videoForDisplay)
.opacity(player.videoForDisplay == nil ? 0 : 1)
}
}
.animation(.default, value: player.currentItem)
}
var maxWidth: Double {
playerBarMaxWidth == "0" ? .infinity : (Double(playerBarMaxWidth) ?? 600)

View File

@ -76,7 +76,7 @@ struct AppSidebarNavigation: View {
}
}
ToolbarItemGroup {
ToolbarItemGroup(placement: accountsMenuToolbarItemPlacement) {
AccountViewButton()
}

View File

@ -120,6 +120,7 @@ struct VideoDetails: View {
}
.modifier(SettingsPickerModifier())
.offset(x: 15, y: 5)
.opacity(descriptionVisibility ? 1 : 0)
#endif
}
@ -214,7 +215,7 @@ struct VideoDetails: View {
)
)
.zIndex(0)
.frame(maxHeight: 15)
.frame(maxHeight: 25)
#endif
}
}

View File

@ -20,6 +20,7 @@ struct WatchNextView: View {
}
}
}
.navigationViewStyle(.stack)
#else
VStack {
HStack {
@ -221,7 +222,7 @@ struct WatchNextView: View {
Divider()
}
let queueForMoreVideos = player.queue.isEmpty ? [] : player.queue.suffix(from: player.playbackMode == .queue ? 1 : 0)
let queueForMoreVideos = player.queue.isEmpty ? [] : player.queue.suffix(from: player.playbackMode == .queue && model.isAutoplaying && model.canAutoplay ? 1 : 0)
if (model.isAutoplaying && model.canAutoplay && !queueForMoreVideos.isEmpty) ||
(!model.isAutoplaying && !queueForMoreVideos.isEmpty)