mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 05:53:41 +00:00
Minor improvements
This commit is contained in:
parent
d80929bd88
commit
16e365ce6c
@ -91,8 +91,6 @@ extension PlayerModel {
|
|||||||
watch.watchedAt = Date()
|
watch.watchedAt = Date()
|
||||||
|
|
||||||
try? self.backgroundContext.save()
|
try? self.backgroundContext.save()
|
||||||
|
|
||||||
FeedModel.shared.calculateUnwatchedFeed()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,6 +664,10 @@ final class PlayerModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleCurrentItemChange() {
|
func handleCurrentItemChange() {
|
||||||
|
if currentItem == nil {
|
||||||
|
FeedModel.shared.calculateUnwatchedFeed()
|
||||||
|
}
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
Windows.player.window?.title = windowTitle
|
Windows.player.window?.title = windowTitle
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,7 +35,7 @@ final class WatchNextViewModel: ObservableObject {
|
|||||||
static let shared = WatchNextViewModel()
|
static let shared = WatchNextViewModel()
|
||||||
|
|
||||||
@Published var item: PlayerQueueItem?
|
@Published var item: PlayerQueueItem?
|
||||||
@Published private(set) var isPresenting = true
|
@Published private(set) var isPresenting = false
|
||||||
@Published var reason: PresentationReason?
|
@Published var reason: PresentationReason?
|
||||||
@Published var page = Page.queue
|
@Published var page = Page.queue
|
||||||
|
|
||||||
|
@ -21,20 +21,18 @@ struct PlayerOverlayModifier: ViewModifier {
|
|||||||
|
|
||||||
@ViewBuilder var overlay: some View {
|
@ViewBuilder var overlay: some View {
|
||||||
Group {
|
Group {
|
||||||
if player.videoForDisplay != nil {
|
|
||||||
ControlsBar(fullScreen: .constant(false), expansionState: $expansionState, playerBar: true)
|
ControlsBar(fullScreen: .constant(false), expansionState: $expansionState, playerBar: true)
|
||||||
.offset(x: expansionState == .mini && !controlsWhenMinimized ? 10 : 0, y: 0)
|
.offset(x: expansionState == .mini && !controlsWhenMinimized ? 10 : 0, y: 0)
|
||||||
.transition(.opacity)
|
|
||||||
.frame(maxWidth: maxWidth, alignment: .trailing)
|
.frame(maxWidth: maxWidth, alignment: .trailing)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
if playerButtonIsExpanded {
|
if playerButtonIsExpanded {
|
||||||
expansionState = .full
|
expansionState = .full
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.animation(.easeIn, value: player.videoForDisplay)
|
||||||
|
.opacity(player.videoForDisplay == nil ? 0 : 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.animation(.default, value: player.currentItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
var maxWidth: Double {
|
var maxWidth: Double {
|
||||||
playerBarMaxWidth == "0" ? .infinity : (Double(playerBarMaxWidth) ?? 600)
|
playerBarMaxWidth == "0" ? .infinity : (Double(playerBarMaxWidth) ?? 600)
|
||||||
|
@ -76,7 +76,7 @@ struct AppSidebarNavigation: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolbarItemGroup {
|
ToolbarItemGroup(placement: accountsMenuToolbarItemPlacement) {
|
||||||
AccountViewButton()
|
AccountViewButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ struct VideoDetails: View {
|
|||||||
}
|
}
|
||||||
.modifier(SettingsPickerModifier())
|
.modifier(SettingsPickerModifier())
|
||||||
.offset(x: 15, y: 5)
|
.offset(x: 15, y: 5)
|
||||||
|
.opacity(descriptionVisibility ? 1 : 0)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +215,7 @@ struct VideoDetails: View {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.zIndex(0)
|
.zIndex(0)
|
||||||
.frame(maxHeight: 15)
|
.frame(maxHeight: 25)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ struct WatchNextView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.navigationViewStyle(.stack)
|
||||||
#else
|
#else
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
@ -221,7 +222,7 @@ struct WatchNextView: View {
|
|||||||
Divider()
|
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) ||
|
if (model.isAutoplaying && model.canAutoplay && !queueForMoreVideos.isEmpty) ||
|
||||||
(!model.isAutoplaying && !queueForMoreVideos.isEmpty)
|
(!model.isAutoplaying && !queueForMoreVideos.isEmpty)
|
||||||
|
Loading…
Reference in New Issue
Block a user