Remove "Show history in player"

This commit is contained in:
Arkadiusz Fal
2022-11-11 14:54:12 +01:00
parent 99e20f54a2
commit 5eafbb1151
6 changed files with 3 additions and 65 deletions

View File

@@ -4,10 +4,10 @@ import SwiftUI
struct NowPlayingView: View {
enum ViewSection: CaseIterable {
case nowPlaying, playingNext, playedPreviously, related, comments, chapters
case nowPlaying, playingNext, related, comments, chapters
}
var sections = [ViewSection.nowPlaying, .playingNext, .playedPreviously, .related]
var sections = [ViewSection.nowPlaying, .playingNext, .related]
var inInfoViewController = false
@State private var repliesID: Comment.ID?
@@ -20,7 +20,6 @@ struct NowPlayingView: View {
@EnvironmentObject<RecentsModel> private var recents
@Default(.saveHistory) private var saveHistory
@Default(.showHistoryInPlayer) private var showHistoryInPlayer
var body: some View {
if inInfoViewController {
@@ -99,31 +98,6 @@ struct NowPlayingView: View {
}
}
if sections.contains(.playedPreviously), saveHistory, showHistoryInPlayer, !visibleWatches.isEmpty {
Section(header: Text("Played Previously")) {
ForEach(visibleWatches, id: \.videoID) { watch in
Button {
player.playHistory(
PlayerQueueItem.from(watch, video: player.historyVideo(watch.videoID))
)
player.show()
} label: {
VideoBanner(
video: player.historyVideo(watch.videoID),
playbackTime: CMTime.secondsInDefaultTimescale(watch.stoppedAt),
videoDuration: watch.videoDuration
)
}
.onAppear {
player.loadHistoryVideoDetails(watch.videoID)
}
.contextMenu {
VideoContextMenuView(video: watch.video)
}
}
}
}
if sections.contains(.comments) {
if comments.disabled {
NoCommentsView(text: "Comments are disabled".localized(), systemImage: "xmark.circle.fill")